Previous <--> Next <==> All
#!/usr/local/bin/perl -s
$ENV{'PATH'} .= ":$ENV{'HOME'}/l/fun/bin:" .
                "$ENV{'HOME'}/l/fun/bin/$ENV{'ARCHIT'}:" .
                "/usr/local/games:/usr/games";
$ENV{'PATH'} .= ":/u/kinzler/l/fun/bin:/u/kinzler/l/fun/bin/sun4";

$dfltnum = 5;

# haiku - front-end for haiku spewer
# Development version 07: eliminate redundant blank line in multi-line haiku
# Steve Kinzler, kinzler@cs.indiana.edu, Jan 96

$usage = "usage: $0 [ -l ] [ number ]
        -l      output single-line haiku format (default multi-line format)
The given number of haiku are generated, default $dfltnum.\n";
die $usage if $h || $ARGV[0] !~ /^\d*$/;

$num = $ARGV[0] || $dfltnum;

###############################################################################

open(HAIKU, "spew $num haikus |") || die "$0: cannot run spew ($!)";

$* = 1;

while (<HAIKU>) {
        $_ = "\u$_";

        unless ($l) {
                s:^:\n: if $. > 1;
                s: / :,\n:g;
        }

        print;
}

close HAIKU;