I assume your example is contrived. If not, you might check to see whether there are at least $_[0] keys.sub foo { my $n = $_[0] ? $_[0] : keys %hash; return wantarray() ? (keys %hash)[0..($n-1)] : $n }
In reply to Re: List context or not?
by dws
in thread List context or not?
by sguazt
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |