#!/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 written?"; } 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_substance'}; } $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 while 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"; } }