SHARE
TWEET

99 Bottles Of Beer

Phr0zen_Penguin Sep 19th, 2014 234 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/perl -w
  2. #!C:\Perl\bin\perl.exe -w
  3. ##
  4. ## NOTE:
  5. ## Your bang path on Windows may vary (depending on where you installed your Perl binaries).
  6. ##
  7. ####
  8. ## [99_bottles_pl.cgi]
  9. ##
  10. ## 99 Bottles Of Beer Lyrics.
  11. ##
  12. ## (c) Damion 'Phr0z3n.dev' Tapper, 2014.
  13. ## Email: Phr0z3n.Dev@Gmail.com
  14. ####
  15.  
  16. use strict; # Strict drinking rules.
  17. use safe;       # Age assessment and such...
  18. use CGI qw(:all);
  19. use utf8;
  20.  
  21. print header(-type => "text/plain");
  22. # To print text/html output, change the new line character from '\n' to '<br />'
  23.  
  24. print '>>------------------> 99 Bottles Of Beer Lyrics <------------------<<' . "\n\n";
  25.  
  26.         for(my $bottles_of_beer = 99; $bottles_of_beer > 0; $bottles_of_beer--)
  27.         {
  28.                 print $bottles_of_beer . ' bottle';
  29.  
  30.                         ($bottles_of_beer != 1) ? print 's' : () ;
  31.  
  32.                 print ' of beer on the wall, ' . $bottles_of_beer . ' bottle';
  33.  
  34.                         ($bottles_of_beer != 1) ? print 's' : () ;
  35.  
  36.                 print ' of beer.' . "\n";
  37.                 print 'Take one down and pass it around, ';
  38.  
  39.                         (($bottles_of_beer -1) != 0) ? (print $bottles_of_beer - 1) : print 'no more' ;
  40.  
  41.                 print ' bottle';
  42.  
  43.                         (($bottles_of_beer - 1) != 1) ? print 's' : () ;
  44.  
  45.                 print ' of beer on the wall.' . "\n\n";
  46.         }
  47.  
  48. print 'No more bottles of beer on the wall, no more bottles of beer.' . "\n";
  49. print 'Go to the store and buy some more, 99 bottles of beer on the wall.' . "\n\n";
  50.  
  51. print '>>-------------------------------> + <-------------------------------<<';
  52.  
  53. exit;
RAW Paste Data
Top