In a conditional, @_ is in scalar context and returns its length.# array passed as list if (@_) { # do non-empty things } else { # do empty things }
After Compline,
Zaxo
In reply to Re: How to determine if an array passed as an argument to a subroutine is zero-length
by Zaxo
in thread How to determine if an array passed as an argument to a subroutine is zero-length
by Withnail
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |