develooper Front page | perl.perl5.porters | Postings from December 2021

Re: "no snails"; or having signatured subs complain about @_

Thread Previous | Thread Next
From:
Paul "LeoNerd" Evans
Date:
December 3, 2021 20:41
Subject:
Re: "no snails"; or having signatured subs complain about @_
Message ID:
20211203204114.1da278ce@shy.leonerd.org.uk
On Fri, 3 Dec 2021 20:58:53 +0100
Juerd Waalboer <juerd@tnx.nl> wrote:

> However, it seems to me that there should be a better, and officially
> supported, way to do this.

Yeah I was probably going to make something like `builtin::argc`, to
give you a way to enquire:

     use builtin 'argc';

     sub bar($self, $new = "blah") {
         $self->{bar} = $new if argc == 2;
         $self->{bar};
     }

-- 
Paul "LeoNerd" Evans

leonerd@leonerd.org.uk      |  https://metacpan.org/author/PEVANS
http://www.leonerd.org.uk/  |  https://www.tindie.com/stores/leonerd/

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About