If the values of in the hash can all be considered "true" (as in your example), then you could simplify this further
Not really.
If the purpose of the quest is to find out if the key exists, then your second example will have an undesired side effect, because it will create 'key01' even if it didn't exist before. So the test is correct, but not its meaning, because key01 will be there, holding an undef value and ready to do havoc next time you use it.
In reply to Re: Re: Best way check key availability
by Anonymous Monk
in thread Best way check key availability
by banduwgs
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |