sub _has_params { return @_ > 1 ? scalar(@_) - 1 : 0; }
How 'bout
sub _has_params { @_ - 1 }
?
It would also check if it is called as a sub with no arguments... oh, well, and it wouldn't catch a call like a sub with exactly one argument...
In reply to Re^2: Controlling the start and endings of method calls
by blazar
in thread Controlling the start and endings of method calls
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |