Actually that is invalid because exists doesn't operate on scalars.
exists argument is not a HASH or ARRAY element or a subroutine at ...
The valid equivalent of that is defined $a && defined $b but don't use $a and $b outside of a sort.
In reply to Re^2: why can't compare a variable with undef directly?
by Mr. Muskrat
in thread why can't compare a variable with undef directly?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |