while (my $text = ) { chomp($text); print "You entered '$text'\n"; last if ($text eq ''); }