# File: makeStringDo.pl # Ask for a letter/string build a word # Do this until you type q(uit) # Author: Mihaela Malita # Input letter? M # More(q-quit)? # Input letter? a # More(q-quit)? # Input letter? t # More(q-quit)? # Input letter? h # More(q-quit)? q $s = ''; # by default string is NULL, but put it here anyway do { print "Input letter? "; $let = ; # Read a char or substring chop($let); # Removes ENTER $s = $s.$let; # Concatenation with . print "More(q-quit)? "; $ans = ; chop($ans); } until( $ans =~ /\s*q/i ); # if answer starts with q and ignore blanks: \s* print "Word is $s"; exit;