in reply to poetry generator (playing with Win32::OLE::Excel )
any hint on how may I make it more "perlish"?Maybe not more Perlish, but certainly a little easier to read:
my $poem = # Line #1 $words[0][rand @{$words[0]}] . " are " . $words[1][rand @{$words[1]}] . " " . $words[2][rand @{$words[2]}] . "?\n" # Line #2, etc... ;
Update: This reminds me of the silly-senetence-generator I hacked together for my young son a few years ago:
# Random silly sentence generator. use warnings; use strict; my @nouns = qw(elephant dog man carrot ocean); my @verbs = qw(is seems appears wants_to_be); my @adjs = qw(hairy smelly purple grimy wobbly); while (1) { my $noun = $nouns [ rand @nouns ]; my $verb = $verbs [ rand @verbs ]; $verb =~ s/_/ /g; my $adj = $adjs [ rand @adjs ]; print "The $noun $verb $adj.\n..."; <STDIN>; # Hit "Enter" on your keyboard for a new sentence. } # Ctrl-C to exit.
|
|---|