In response to johnathon's
question, I tried to make a poem without using
my or
die!
$patience = 15; # how many years can you wait for happiness?
$happy = -10; # how happy are you now?
$cant_go_on = -5000; # how unhappy can you be before its not worth
+it?
$memory = 16384; # how much can you remember?
# What makes life good?
@GOODTHINGS = ("love", "beauty", "innocence", "happiness", "friends",
+"nature", "life");
# What makes it painful/stressful/depressing?
@BADTHINGS = ("greed", "money", "power", "corruption", "depression", "
+lunacy", "illness", "death");
CONSIDER: { open(LIFE, "<life.txt"); } # reflect on our life..
CYCLE: while(!$happy && $patience) {
select LIFE;
$age++;
$time = tell;
$patience--;
read LIFE, $year, $memory;
$memory--;
if($year) {
foreach $good (@GOODTHINGS) {
while($year =~ /$good/g) {
$happy++;
}
}
foreach $bad (@BADTHINGS) {
while($year =~ /$bad/g) {
$happy--;
}
}
}
}
if(!$patience) {
# reconsider our life if we've run out of patience
goto CONSIDER unless $happy <= $cant_go_on; $happy=undef;
# if we can't go on, then sleep forever
sleep;
}
else {
# revel in our happiness!
&enjoy($happy);
redo CYCLE; # continue our life..
}
sub enjoy {
$reset = 0;
$patience = 15 - ($age/15); # Regen patience :)
$memory = 16384 - 10*$age; # Refesh your mind :)
$happy = $reset; # but now it wears off..
}
maybe I should stop writing perl poetry and get back to work? hehehehe..
-brad..