In my opinion, after "($key, $value)" are assigned to "()" and list becomes "(undef, undef)", scalar context takes only the last element of the list, that means 2nd "undef". Am I wrong?
Compare:
$ perl -E 'say scalar ( ($a, $b) = () )' 0 $ perl -E 'say scalar ( ($a, $b) = (undef, undef) )' 2
In reply to Re: each %hash: scalar context of list (undef, undef) is false
by Anonymous Monk
in thread each %hash: scalar context of list (undef, undef) is false
by rsFalse
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |