I keep a few chickens in my backyard, and I think I once mentioned that I could code up chicken behaviour in half a page of perl. Well, my poetry is awful, but this compiles and runs happily with a standard perl distro.
Cheers,
Paul
use Carp qw/cluck/;
my @chickens;
sleep until $dawn;
cluck $loudly until open $coop;
exit $coop;
chomp $food and accept($scraps,$seed);
shift @straw, pop @eggs and cluck $more;
until ($dusk) {
seek($many,$worms,$bugs);
join flock($other,@chickens) if split /from others/;
tell WORLD,"sky is falling" if $airplane;
}
return 2,$coop and sleep until $dawn;
I can't believe I just posted that.