![]() |
|
No such thing as a small change | |
PerlMonks |
Re: Distinguish between missing and undefined arguments with subroutine signaturesby LanX (Sage) |
on Dec 27, 2020 at 18:52 UTC ( #11125808=note: print w/replies, xml ) | Need Help?? |
> Is there a common idiom how to handle such case with signatures? The rule of thumb is to use a default which is defined. ° Using undef as default should be redundant and will force you to check @_ - if still possible (untested) Sorry, your code is longish (aka TLDR), if I didn't get it right, please consider condensing it to the relevant part. This question could be actually very relevant if there is a real use case! P5P is considering to drop the population of @_ when signatures are used.
Cheers Rolf
update°) not
In Section
Seekers of Perl Wisdom
|
|