|Keep It Simple, Stupid|
Re: Contents of @_ using subroutine signatures with default values (not a bug)by LanX (Sage)
|on Jul 14, 2020 at 12:16 UTC||Need Help??|
I'm not sure if I understand your problem ...
... the call foo("a") is exactly doing what I expect, i.e. @_ == 1
Anything else - like pushing an optional $that into @_ - wouldn't really be backwards compatible.
And the number you seem to want is static, it's the sum of obligatory arguments + defaulted ones.
(maybe you want to make a feature request to be able to introspect the signature)
FWIW, when interested you can look into the implementation with B::Deparse ...
expanded code with tests