If your keys/indices are just consecutive numbers, an array (instead of the hash) might be a
slightly more "natural" implementation... (not much of an issue, though).
...
my $number = int(rand(5));
my @poems = (
"Even in Kyoto:hearing the cuckoo's cry--:I long for Kyoto.:Basho",
"In this world:We walk on the roof of hell:Gazing at flowers.:Issa",
"The old pond--:a frog jumps in,:sound of water.:Basho",
"In the white plum blossoms:night to next day:just turning.:Buson",
"Sick on a journey,:my dreams wander:the withered fields.:Basho",
);
my ($line1, $line2, $line3, $author) = split ":", $poems[$number];
...