#!/usr/bin/perl use strict; use warnings; my $number = int(rand(5)) + 1; my %poems = ( 1 => "Even in Kyoto:hearing the cuckoo's cry--:I long for Kyoto.:Basho", 2 => "In this world:We walk on the roof of hell:Gazing at flowers.:Issa", 3 => "The old pond--:a frog jumps in,:sound of water.:Basho", 4 => "In the white plum blossoms:night to next day:just turning.:Buson", 5 => "Sick on a journey,:my dreams wander:the withered fields.:Basho", ); my ($line1, $line2, $line3, $author) = split ":", $poems{$number}; print " $line1\n$line2\n $line3\n\t$author\n";