in reply to Re: Controlling the start and endings of method calls
in thread Controlling the start and endings of method calls
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...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Controlling the start and endings of method calls
by davido (Cardinal) on Feb 02, 2006 at 16:34 UTC | |
by blazar (Canon) on Feb 02, 2006 at 18:30 UTC |