in reply to Re^2: Illegal division by zero error
in thread Illegal division by zero error
So you have ascertained that the error happens because you enter that block of code but $array[4] contains a value that Perl interprets as zero.
Maybe you don't want to enter that block if $array[4] contains a value that Perl interprets as zero? Maybe you want to prevent processing invalid lines that leave invalid values in @F?
You have not shown examples of valid and problematic lines, so we can only guess and trace the path of execution backwards from where the error happens. If you tell us what you want to avoid, or for what kind of lines the error happens, maybe we can better find a solution with you.
Maybe you want to skip processing empty lines?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Illegal division by zero error
by TJCooper (Beadle) on Feb 01, 2016 at 16:51 UTC | |
by Corion (Patriarch) on Feb 01, 2016 at 16:56 UTC | |
by TJCooper (Beadle) on Feb 01, 2016 at 17:03 UTC | |
by Corion (Patriarch) on Feb 01, 2016 at 17:50 UTC |