# File: length.pl # Title: The length of a string. length(String) # Author: Mihaela Malita # Input a string? Leibniz # Length is 7 # Continue(y/n)? y # Input a string? Blaise Pascal # Length is 13 -- blank is also counted!! # Continue(y/n)? n # Bye $yesorno = "y"; while ($yesorno eq "y") { print "Input a string? "; $s = ; chop($s); # delete last char that is print "Length is ", length($s) ; print("\nContinue(y/n)? "); $yesorno = ; chop($yesorno); # delete last char that is } print "\nBye"; exit;