develooper Front page | perl.perl5.porters | Postings from February 2019

New defined-match operator

Thread Next
David Cantrell
February 21, 2019 12:12
New defined-match operator
Message ID:
We all know how convenient it is to write this:

  $foo //= 'bar';

instead of:

  $foo = 'bar' unless(defined($foo));

Well, wouldn't it be nice to be able to write this:

  if($foo //~ /bar/)

instead of:

  if(defined($foo) && $foo =~ /bar/)


David Cantrell | Enforcer, South London Linguistic Massive

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About