Guest User

Untitled

a guest
Jul 20th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. #!/usr/bin/perl -w
  2.  
  3. #Multiplying a string n times
  4.  
  5. print "Enter a string: ";
  6. chomp($fn = <STDIN>);
  7. print "Enter a number: ";
  8. chomp($sn = <STDIN>);
  9.  
  10. if ($sn > 50) {
  11. print "Thats too much, mang!\n";
  12. }
  13.  
  14. else {
  15. print "You want to print the string \'$fn\' \'$sn\' times. All right, here it is:\n";
  16. $n = 1;
  17. while ($n le $sn) {
  18. print "$n: $fn\n";
  19. $n++;
  20. }
  21. }
Add Comment
Please, Sign In to add comment