Well, if you want to throw when the string is empty, then you have several choices:
orlength( $HashOfTNBs{$rec_count}{$subindex} = $1 ) or throw TNBCriticalColException( "Cannot add multiple key entry in hash array" );
to show just two.if( "" eq ( $HashOfTNBs{$rec_count}{$subindex} = $1 ) ) { throw TNBCriticalColException( "Cannot add multiple key entry in hash array" ); }
But you are checking $1 which makes me think that perhaps you should instead be checking the success of the regular expression that you hope is setting $1. If the regular expression fails then $1 is left unchanged which would leave it undefined if you have no other regular expressions run before that (which might make you think that your code is working better than it is) but can also leave $1 set to the results of some previous regular expression.
- tyeIn reply to Re: "0" or throw problem (wrong check)
by tye
in thread "0" or throw problem
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |