in reply to General question about a haiku program
Since "laziness is a virtue", I let Tie::File do the file I/O:
...roboticus#!/usr/bin/perl use strict; use warnings; use Tie::File; tie my @haiku, 'Tie::File', $0 or die "FOO!"; my $number = 4 * int(rand(@haiku/4 - 2) + 2); print join "\n", @haiku[$number..$number+3]; __END__ 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
|
|---|