Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: Haiku generator

by ambrus (Abbot)
on Mar 04, 2006 at 21:34 UTC ( #534524=note: print w/replies, xml ) Need Help??


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,

    hypknotizzed

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://534524]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (2)
As of 2022-09-28 03:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I prefer my indexes to start at:




    Results (124 votes). Check out past polls.

    Notices?