<h2 id="overview">Overview</h2>
<p>I live on my own, but I cook for members of my family from time to time. Each week we all get together and cook dinner for Wednesday and Thursday. I usually do the cooking but we are starting to share these duties for certain meals.</p>
<p>In 2019 I thought it would be useful if I had some sort of random chooser to decide what next week’s meal was going to be. I wrote a Bash script called <code>choose_meal</code>, using a simple CSV file of meal names and the date last eaten to avoid choosing the same one too often. The shortcomings of this approach soon became apparent!</p>
<p>It wasn’t long before <code>choose_meal</code> was rewritten in <a href="https://www.perl.org/" title="Perl scripting language">Perl</a>. This time I decided to use a database, and chose <a href="https://www.sqlite.org/index.html"><code>SQLite</code></a> to create it. My database contained just two tables, one for the meals themselves (called slightly confusingly <code>'meal_history'</code>), and another for a record of the choices made (called <code>'meal_log'</code>) – the ability to produce historical reports seemed like a desirable feature!</p>
<p>In 2019 the design of this system was very specific to our needs: one choice per week on a Wednesday. It was not something that could be used by anyone else – which seemed like a bad idea.</p>
<p>In late 2020 and early 2021 the system was redesigned, as will be discussed in the detailed notes. In May 2021 a more general design was added to the public <a href="https://gitlab.com/davmo/weekly_menus" title="Weekly Menus repository">GitLab repository</a> and the preparation of this show was begun.</p>
<p>I had never intended this system to hold recipes. This was partly because I have built a collection of recipes I have constructed from various sources and amended as I have made them. I print these and keep them in a ring-binder for reference as I cook. In some cases the meals described in the database are multi-component ones (such as the dishes that make up a curry for example), so it doesn’t seem appropriate to hold these here.</p>
<p>I might rethink this in the future however.</p>
<h2 id="long-notes">Long notes</h2>
<p>Follow this link to <a href="https://hackerpublicradio.org/eps/hpr3386/full_shownotes.html">read the detailed notes</a> associated with this episode.</p>
<h2 id="links">Links</h2>
<ul>
<li><p><a href="https://www.perl.org/">Perl</a></p>
<ul>
<li><a href="https://www.perl.org/get.html">Perl 5</a>: (currently v5.35.0)</li>
<li><a href="https://www.raku.org/">Raku</a>: originally called Perl 6, a totally different scripting language.</li>
<li><a href="https://www.perl.com/article/announcing-perl-7/">Perl 7</a>: updates to Perl 5, removal of some historical stuff</li>
</ul></li>
<li><p><a href="https://www.sqlite.org/index.html">SQLite</a>: a C-language library that implements a small, fast, self-contained, high-reliability, full-featured, SQL database engine.</p></li>
<li><p><a href="https://gitlab.com/davmo/weekly_menus">GitLab repository for <em>Weekly Menus</em></a></p></li>
</ul>