tamaguchi has asked for the wisdom of the Perl Monks concerning the following question:
The problem is that if I dont have an empty row at the bottom of the infile I get the following error message: "Use of uninitialised value in pattern match (m//) at C:/bla/bla.." This doesn´t cause other trubbles more then that it is irritating. I frequently encounter this problem so I would be happy if you could give me an advice how to get rid of this problem. Thank youwhile((my $line=<EXP>)=~/\S/) { chomp($line); (my ($k), my ($v))=split('=>', $line); $k=~s/\s//; $v=~s/\s//; $experimental_hash{$k}=$v; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Error message while reading from file
by salva (Canon) on Feb 17, 2006 at 11:41 UTC | |
|
Re: Error message while reading from file
by izut (Chaplain) on Feb 17, 2006 at 11:38 UTC | |
by davorg (Chancellor) on Feb 17, 2006 at 11:49 UTC | |
by salva (Canon) on Feb 17, 2006 at 11:46 UTC | |
|
Re: Error message while reading from file
by Aristotle (Chancellor) on Feb 20, 2006 at 00:30 UTC |