Blob
1 #!/usr/bin/perl3 # Write a program that prompts for and reads a string and a number (on separate4 # lines of input) and prints out the string the number of times indicated by5 # the number of separate lines. (Hint: use the x operator.) If the user enters6 # "fred" and "3", the output should be three lines, each saying "fred". If the7 # user enters "fred" and "299792", there may be a lot of output.9 use warnings;10 use strict;11 use utf8;13 print "string = ";14 my $str = <STDIN>;15 print "repeat = ";16 chomp(my $r = <STDIN>);18 print $str x $r;