Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: Perl5 Language Extension: Definedness-Triggered Shortcut Operators

by JavaFan (Canon)
on Mar 18, 2012 at 12:20 UTC ( #960284=note: print w/ replies, xml ) Need Help??


in reply to Re: Perl5 Language Extension: Definedness-Triggered Shortcut Operators
in thread RFC: Perl5 Language Extension: Definedness-Triggered Shortcut Operators

A &&& B   # defined-and
You're not the first. Here's the reason why it's a bad idea:
$ perl -ce 'A &&& B' -e syntax OK
It's not worth breaking backwards compatability for this.


Comment on Re^2: Perl5 Language Extension: Definedness-Triggered Shortcut Operators
Select or Download Code
Re^3: Perl5 Language Extension: Definedness-Triggered Shortcut Operators
by martin (Friar) on Mar 20, 2012 at 17:42 UTC

    You are right, triple ampersand parses as "boolean and" followed by a "subroutine call sigil". Too bad.

      The odds of there being code in the wild that does $a&&&foo() with no space seem pretty slim to me. It even seems rather unlikely in an obfu. Not that I have personally witnessed p5p be swayed by such arguments before.

      The odds of "$a &&& $b" being non-broken code in the wild seems even slimmer.

      - tye        

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://960284]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (9)
As of 2015-07-03 15:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (53 votes), past polls