http://qs321.pair.com?node_id=272916

dannoura has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

This should be a simple one. Whenever I use code similar to:

#! c:\perl\bin use strict; use warnings; open (FH, "somefile.txt") or die("cannot open file"); foreach (<FH>) { print if ($_=~/foo/); }

I get a lot of uninitialized value warnings. I assume this is because there are empty lines at the end of the file, but I'm not sure and also even if this is the case I don't know how to get rid of the warnings (except for turning off use warnings).

Any ideas?