Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl -w
- #!C:\Perl\bin\perl.exe -w
- ##
- ## NOTE:
- ## Your bang path on Windows may vary (depending on where you installed your Perl binaries).
- ##
- ####
- ## [99_bottles_pl.cgi]
- ##
- ## 99 Bottles Of Beer Lyrics.
- ##
- ## (c) Damion 'Phr0z3n.dev' Tapper, 2014.
- ## Email: Phr0z3n.Dev@Gmail.com
- ####
- use strict; # Strict drinking rules.
- use safe; # Age assessment and such...
- use CGI qw(:all);
- use utf8;
- print header(-type => "text/plain");
- # To print text/html output, change the new line character from '\n' to '<br />'
- print '>>------------------> 99 Bottles Of Beer Lyrics <------------------<<' . "\n\n";
- for(my $bottles_of_beer = 99; $bottles_of_beer > 0; $bottles_of_beer--)
- {
- print $bottles_of_beer . ' bottle';
- ($bottles_of_beer != 1) ? print 's' : () ;
- print ' of beer on the wall, ' . $bottles_of_beer . ' bottle';
- ($bottles_of_beer != 1) ? print 's' : () ;
- print ' of beer.' . "\n";
- print 'Take one down and pass it around, ';
- (($bottles_of_beer -1) != 0) ? (print $bottles_of_beer - 1) : print 'no more' ;
- print ' bottle';
- (($bottles_of_beer - 1) != 1) ? print 's' : () ;
- print ' of beer on the wall.' . "\n\n";
- }
- print 'No more bottles of beer on the wall, no more bottles of beer.' . "\n";
- print 'Go to the store and buy some more, 99 bottles of beer on the wall.' . "\n\n";
- print '>>-------------------------------> + <-------------------------------<<';
- exit;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement