for my $str ("foo\n", "bar\n") { chomp $str; print $str; }