in reply to Re: Haiku generator
in thread Haiku generator
But then, why not just iterate through the array directly?
use warnings; use strict; my @haiku = ( [ 'annoying sensei', 'oh, young grasshopper', 'dis-honourable', 'you aburi brain' ], [ 'learn to run before you walk', 'he thinks he knows everything', 'insubordinate pupil', ], [ 'hey, wait a minute', 'he must be senile', 'he will face my wrath', 'his brain is not well' ], ); for my $line (@haiku) { print $$line[rand @$line], "\n"; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Haiku generator
by hypknotizzed (Beadle) on Mar 04, 2006 at 21:48 UTC |
In Section
Cool Uses for Perl