Phr0zen_Penguin

99 Bottles Of Beer

Sep 19th, 2014
388
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 1.29 KB | None | 0 0
  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]
  9. ##
  10. ## 99 Bottles Of Beer Lyrics.
  11. ##
  12. ## (c) Damion 'Phr0z3n.dev' Tapper, 2014.
  13. ####
  14.  
  15. use strict; # Strict drinking rules.
  16. use safe;   # Age assessment and such...
  17. use utf8;
  18.  
  19. print '>>------------------> 99 Bottles Of Beer Lyrics <------------------<<' . "\n\n";
  20.  
  21.     for(my $bottles_of_beer = 99; $bottles_of_beer > 0; $bottles_of_beer--)
  22.     {
  23.         print $bottles_of_beer . ' bottle';
  24.  
  25.             ($bottles_of_beer != 1) ? print 's' : () ;
  26.  
  27.         print ' of beer on the wall, ' . $bottles_of_beer . ' bottle';
  28.  
  29.             ($bottles_of_beer != 1) ? print 's' : () ;
  30.  
  31.         print ' of beer.' . "\n";
  32.         print 'Take one down and pass it around, ';
  33.  
  34.             (($bottles_of_beer -1) != 0) ? (print $bottles_of_beer - 1) : print 'no more' ;
  35.  
  36.         print ' bottle';
  37.  
  38.             (($bottles_of_beer - 1) != 1) ? print 's' : () ;
  39.  
  40.         print ' of beer on the wall.' . "\n\n";
  41.     }
  42.  
  43. print 'No more bottles of beer on the wall, no more bottles of beer.' . "\n";
  44. print 'Go to the store and buy some more, 99 bottles of beer on the wall.' . "\n\n";
  45.  
  46. print '>>-------------------------------> + <-------------------------------<<';
  47.  
  48. exit;
Advertisement
Add Comment
Please, Sign In to add comment