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
    Hey ambrus, thanks for the advice but I'm new so I haven't learned loops yet. Thanks for the help.

    SOA, DOA, GOA, whatever,