use strict; open(my $foo, "){ chomp; print "Saw $_ in data.txt\n"; } close $foo;