If you really wanted to get the count of items in the array returned, you could do it thus:
The trick with the "@{[]}" is described in perfunc, under the function "scalar".sub x{return qw/e f g h 31/}; $a= @{[x()]}; # Force array context when calling sub print $a This prints the value 5
In reply to Re: subroutine list return
by NetWallah
in thread subroutine list return
by GhodMode
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |