Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
How would I go about producing the following output -%verbs = {"jumped","eat","killed"}; %pronoun = {"I","You","He","She"};
using code something like this -He jumped She killed I eat
I otherwords, what should I use in place of $RANDOM_PRONOUNforeach my $verb (shuffle keys %verb) { print $RANDOM_PRONOUN.' '.$verb.';' }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Select randomly from a hash
by Zaxo (Archbishop) on Oct 16, 2004 at 22:43 UTC | |
Re: Select randomly from a hash
by pg (Canon) on Oct 16, 2004 at 22:41 UTC | |
Re: Select randomly from a hash
by Enlil (Parson) on Oct 16, 2004 at 22:44 UTC | |
Re: Select randomly from a hash
by davido (Cardinal) on Oct 17, 2004 at 04:02 UTC | |
Re: Select randomly from a hash
by steves (Curate) on Oct 16, 2004 at 22:43 UTC | |
by Fletch (Bishop) on Oct 17, 2004 at 01:35 UTC | |
by davido (Cardinal) on Oct 17, 2004 at 03:50 UTC |