Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
The problem is that when $1 = 0 it throws the error - rightly so.#$HashOfTNBs{$rec_count}{$subindex} = $1 or throw TNBCriticalColExcept +ion("Cannot add multiple key entry in hash array");
However even when I bracket the assignment the same happens.
How can I check whether a statement executes successfully without having to wrap it in a mod and create a return code and then check it.
I'm sure there is a simple one liner way of doing this but I cant quite get the syntax right.
tks
Edit by tye to preserve formatting
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: "0" or throw problem (wrong check)
by tye (Sage) on Mar 10, 2003 at 17:25 UTC | |
|
Re: Eval Issue
by Elian (Parson) on Mar 10, 2003 at 16:40 UTC | |
|
Re: "0" or throw problem
by jonadab (Parson) on Mar 11, 2003 at 12:19 UTC |