use warnings; use strict; open my $fh, '<', "file.txt" or die "can't open the flippin' flabergastin' file!: $!"; while (<$fh>){ chomp; print "something here $_\n"; }