in reply to Select randomly from a hash
Syntax error. I think you wanted @verbs, and @pronouns, not hash.
You can do something like:
use warnings; use strict; my @verbs = ("jumped","eat","killed"); my @pronoun = ("I","You","He","She"); while (1) { print $pronoun[rand @pronoun] . " " . $verbs[rand @verbs], "\n"; sleep(1); }
|
---|