Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

my @chickens

by pjf (Curate)
on Oct 04, 2001 at 06:33 UTC ( #116627=poem: print w/replies, xml ) Need Help??

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.


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.

Replies are listed 'Best First'.
(MeowChow) Re: my @chickens
by MeowChow (Vicar) on Oct 05, 2001 at 07:15 UTC
      I did think of having a "chop $head and die" type verse, but I'm a vegetarian, and really have no desire to eat the poor chooks. So this was an intentional omission. :)


Re: my @chickens
by John M. Dlugosz (Monsignor) on Oct 04, 2001 at 08:18 UTC
    When you run it, it quits at the "exit" line near the top.

    I like it.

      Getting it to reach the exit is a little hard... "sleep until $dawn" tends to sleep a very long time indeed. ;) If only my real chickens would let me sleep in each morning.

      Thanks for the compliment. I'm glad it's been amusing.



Re: my @chickens
by blackjudas (Pilgrim) on Oct 04, 2001 at 22:37 UTC
    I think you've got an excellent imagination, and it compiles too :) ++.
Re: my @chickens
by FlashM (Novice) on Oct 07, 2001 at 09:07 UTC
    You're a nutcase... but I'm glad 'cos it made me laugh... thanks :)
Re: my @chickens
by Elliott (Pilgrim) on Oct 07, 2001 at 21:37 UTC
    After Great Perl Literature, how about Perl Movies?
    $batman=~s/\&//g; print "<A HREF=\"index.html\">Fly</A>"; print "<A HREF=\"javascript:opener.location.href=index.html\;self.clos +e\;\">"; sub marine{$paint="ffff00"} while($u){sleep} sub seattle{while(1==2){sleep}} $i="ffd700"; sub mummy{return} $shark{$colour}="0000ff"; my $love;undef $love; splice(my @best,$friend); $man[2]; @man=qw(grumpy sore indignant huffish bitter aggravated wrathful vexed + ireful enraged furious cross);
    Batman and Robin (Batman "and" robbing - ouch)
    Fly Away Home
    Home Alone
    Yellow Submarine
    While You Were Sleeping
    Sleepless in Seattle
    The Mummy Returns
    Blue Shark Hash
    Goodbye My Love
    My Best Friend's Wedding
    The Third Man
    Twelve Angry Men
      A large collection of Perl movies is already here.


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: poem [id://116627]
Approved by root
[marioroy]: might need 2 or 3 backslash for \n. Also \\;
[Lady_Aleena]: shmem, there is MP3::Info/
[Discipulus]: too much complex qx when you know perl are better to avoid
[marioroy]: might need to backslash \'*.mp3\'
[marioroy]: It's a quoting issue inside qx. It's File::Find or qx. LA chooses qx. Almost there.
[marioroy]: Also \"%S\\\n\" oh my, not fun.
[Discipulus]: good night folks
[marioroy]: I will make a mp3info script that takes the -p "%S\n" args and test qx. I'm on the road, so will come back.
[marioroy]: All because File::Find is not fun for LA.
[marioroy]: good night Discipulus.

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (11)
As of 2017-04-23 21:17 GMT
Find Nodes?
    Voting Booth?
    I'm a fool:

    Results (432 votes). Check out past polls.