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

Re: New defined-match operator

Thread Previous | Thread Next
David Nicol
February 21, 2019 20:11
Re: New defined-match operator
Message ID:
> > instead of:
> >
> >   if(defined($foo) && $foo =~ /bar/)

the only improvement on that I can come up with is to write it

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

if we're pitching new syntax, how about a loquacious variant of =~ m,
spelled "matches"?

   if(defined($foo) and $foo matches /bar/)

The dangerous coffee suggests then having a loquacious variant of =~ s ...
which as it cuts and pastes, might be called "scissors"

then we could play with matches and run with scissors :)

"I don't know about that, as it is outside of my area of expertise." --
competent specialized practitioners, all the time

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