Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re^2: Shortcut operator for $a->{'b'}=$b if $b;

by Aristotle (Chancellor)
on Sep 20, 2005 at 20:35 UTC ( #493596=note: print w/ replies, xml ) Need Help??

in reply to Re: Shortcut operator for $a->{'b'}=$b if $b;
in thread Shortcut operator for $a->{'b'}=$b if $b;

It doesn’t “abort” the assignment – the logical OR is evaluated first, then possibly the last, and if that is evaluated, it prevents the assignment from evaluating at all. And thus it works.

Makeshifts last the longest.

Comment on Re^2: Shortcut operator for $a->{'b'}=$b if $b;
Download Code
Replies are listed 'Best First'.
Re^3: Shortcut operator for $a->{'b'}=$b if $b;
by CountZero (Bishop) on Sep 20, 2005 at 21:15 UTC
    And thereby logical false values do not get assigned, which is not as per the specs.


    "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

      You should re-read the OP's post. It says "The point is to have no key 'b' exist if $b is false."

      Caution: Contents may have been coded under pressure.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2015-12-02 02:20 GMT
Find Nodes?
    Voting Booth?

    My keyboard shows this many letters:

    Results (31 votes), past polls