#!/usr/bin/perl ----^^--------- # you have an "e" here #### use warnings; use strict; my $fh = open '<', 'Test1.txt' or die "can't open the damned file!: $!"; while (<$fh>){ chomp; # this will remove the newline from $_ print "I saw $_ in the file\n"; } #### #!/usr/bin/perl #### #/user/bin/perl ----^-- remove the "e"