One of the exercises that you often receive in beginning programming classes is to write a recipe in such detail that a computer would understand, if it could understand your native language. Of course, this isn't possible, so I decided to make the task a bit easier for the computer.
#!/usr/bin/perl -w use strict; use Carp; use vars qw($pleasure $I $lunch); my %ingredient = ( butter => '1/4 cups', milk => '1/4 cups', macaroni => '1 1/2 cups', water => '6 cups', salt => '1 pinch', cheese_like_substance => '1 pouch' ); open BOOK, "<" , "Cryptonomicon" or carp "Where's my friggin' book?! $ +!\n"; my @pot = ($ingredient{'water'}, $ingredient{'salt'}); for my $water_temperature (75..212) { read BOOK, $pleasure, 2048 or die "What else has Neal Stephenson w +ritten?"; } push @pot, $ingredient{'macaroni'}; STIR_MACARONI: { for my $minutes (7..10) { read BOOK, $pleasure, 2048 or die "I need another book!"; last STIR_MACARONI if ($ingredient{'macaroni'} eq 'glue'); } } splice @pot, $#pot/2, 0, $ingredient{'butter'}; my $pot = join '', @pot; $pot .= $ingredient{'milk'}; STIR_MACARONI_AGAIN: { my @lunch = split //, $pot; for (0..10) { splice @lunch, rand($#lunch), 0, $ingredient{'cheese_like_subs +tance'}; } $lunch = join '', @lunch; } if ($I eq eat($lunch)) { read BOOK, $pleasure, 2048 or carp "I hate mac and cheese. It's just something to do whi +le reading."; } sub eat { my $food = shift; if (BOOK) { for (0..length($food)) { $food = substr $food, 0, (length($food) - 1); } } else { print "$food must be good if you ain't reading!\n"; } }

In reply to Macaroni and Cheese by Ovid

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.