exit 0 unless exists $pages{$page} and defined $pages{$page} and $pages{$page} == 1;
Is the exists test really necessary here? Shouldn't the test for defined suffice? In my (admittedly limited :-) experience, a perl variable that is defined necessarily exists, so:
exit 0 unless defined $pages{$page} and $pages{$page} == 1;
should suffice.
But perhaps I'm missing something, and you can show some instance where both tests are needed?
TIA
dave
In reply to Re: Re: Unintialised value?
by Not_a_Number
in thread Unintialised value?
by eoin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |