Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl -w
- #Multiplying a string n times
- print "Enter a string: ";
- chomp($fn = <STDIN>);
- print "Enter a number: ";
- chomp($sn = <STDIN>);
- if ($sn > 50) {
- print "Thats too much, mang!\n";
- }
- else {
- print "You want to print the string \'$fn\' \'$sn\' times. All right, here it is:\n";
- $n = 1;
- while ($n le $sn) {
- print "$n: $fn\n";
- $n++;
- }
- }
Add Comment
Please, Sign In to add comment