chomp in a while statement
while (chomp($input = <>)) { print "You typed: $input\n" unless $input eq 'L'; }