in reply to Getting rid of uninitialized value warning (was: can't spot the error)
Should sort you out.$array[13]="" unless defined $array[13]; $array[14]="" unless defined $array[14];
BTW, a more idomatic way to write your loop would be
while (<FILEHANDLE>) { chomp; my @array=split/\s+/; $array[13]="" unless defined $array[13]; $array[14]="" unless defined $array[14]; print "$array[13]\t$array[14]\n"; print OUTFILE "$array[13]\t$array[14]\n"; }
Yves / DeMerphq
---
Writing a good benchmark isnt as easy as it might look.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: can't spot the error
by converter (Priest) on May 07, 2002 at 17:29 UTC | |
by demerphq (Chancellor) on May 08, 2002 at 08:46 UTC |