http://www.perlmonks.org?node_id=11125813


in reply to Re: Distinguish between missing and undefined arguments with subroutine signatures
in thread Distinguish between missing and undefined arguments with subroutine signatures

P5P is considering to drop the population of @_ when signatures are used
But only after alternative facilities for argument instrospection have been provided. See the proposal on the p5p mailing list.

In particular, in

sub foo($x, ??$has_y, $y = 0) { ... }
$has_y is true if and only if a second arg is passed to the sub.

Dave.

  • Comment on Re^2: Distinguish between missing and undefined arguments with subroutine signatures
  • Download Code

Replies are listed 'Best First'.
Re^3: Distinguish between missing and undefined arguments with subroutine signatures
by jo37 (Hermit) on Dec 27, 2020 at 20:31 UTC
    sub foo($x, ??$has_y, $y = 0) { ... }

    Great! That's it. (Or better: Will be)

    Greetings,
    -jo

    $gryYup$d0ylprbpriprrYpkJl2xyl~rzg??P~5lp2hyl0p$