# File: count1.pl # Title: Asks the user for a word and a number, then repeats the word that number of times. # Author: Mihaela Malita # Enter a word? nucleotide # Repeat it how many times? 3 # 1: nucleotide # 2: nucleotide # 3: nucleotide # Continue(y/n)? n # Bye $yesorno = 'y'; while ($yesorno eq 'y') { print "Enter the word? "; $s = ; chop($s); print "Repeat it how many times? "; $n = ; chop($n); for (1..$n) { print $_,": ",$s, "\n"; } print "\nContinue(y/n)? "; $yesorno = ; chop($yesorno); } print "Goodbye"; exit;