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?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: uninitialized value warning in reading file
by ant9000 (Monk) on Jul 10, 2003 at 10:12 UTC | |
by tos (Deacon) on Jul 10, 2003 at 12:30 UTC | |
Re: uninitialized value warning in reading file
by Anonymous Monk on Jul 10, 2003 at 10:21 UTC |
Back to
Seekers of Perl Wisdom