develooper Front page | perl.perl5.porters | Postings from October 2016

Re: Extend the fat comma to deal with undef

Thread Previous | Thread Next
From:
Aristotle Pagaltzis
Date:
October 6, 2016 18:52
Subject:
Re: Extend the fat comma to deal with undef
Message ID:
20161006185203.GA93464@plasmasturm.org
* Sam Kington <sam@illuminated.co.uk> [2016-10-06 07:00]:
>     mandatory(
>         thing => $thing,
>         this =>! this_does_something(),
>         that =>! that_does_something(),
>     );

      mandatory(
          thing => $thing,
          this => this_does_something() // undef,
          that => that_does_something() // undef,
      );

(The traditional way was with scalar(), but //undef is a bit nicer
in that it’s not circumfix.)

Regards,
-- 
Aristotle Pagaltzis // <http://plasmasturm.org/>

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