Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- # This program outputs the Stream song.
- # Input: on command-line
- # Output: on STDOUT
- use warnings;
- use strict;
- sub echoes {
- my $words=shift;
- my $item=shift;
- my $a="$words $item";
- return "$a\n($a)\n";
- }
- my @items=("stream"); my $r;
- print echoes("There was a",$items[0]);
- goto B;
- A:
- $r=shift||exit;
- print echoes("And on that",$items[0]);
- unshift @items,$r;
- print echoes("There was a little",$items[0]);
- B:
- print echoes("Just a teeny-weeny",$items[0]);
- for(1..$#items){
- printf("And the %s was on a %s\n",$items[$_-1],$items[$_]);
- }
- print "And the stream was on its way...
- Where the moon shines high
- In the clear blue sky
- And all was bright and gay.
- ";
- goto A;
Add Comment
Please, Sign In to add comment