You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ perl -wle 'use Function::Parameters qw(:strict); method foo($bar) {} main->foo()'
Too few arguments for method foo (expected 2, got 1) at -e line 1.
main::foo("main") called at -e line 1
I would expect that to say "expected 1, got 0".
From the caller's point of view, the invocant is not an argument. If you asked someone how many arguments are being passed to $obj->method(1, 2, 3) they'd say three, not four. That Perl methods put the invocant on the argument stack is an odd quirk of Perl.
The text was updated successfully, but these errors were encountered:
I would expect that to say "expected 1, got 0".
From the caller's point of view, the invocant is not an argument. If you asked someone how many arguments are being passed to
$obj->method(1, 2, 3)
they'd say three, not four. That Perl methods put the invocant on the argument stack is an odd quirk of Perl.The text was updated successfully, but these errors were encountered: