Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Assign Contains RegEx WTF??

by ikegami (Patriarch)
on May 19, 2009 at 15:25 UTC ( [id://764943]=note: print w/replies, xml ) Need Help??


in reply to Assign Contains RegEx WTF??

It's just like ($x + $y) * $z. The contents of the parens are evaluated first, and the result is used as the operand of the operation outside the parens.

Scalar assignment returns its LHS as an lvalue, so

($bname = $fname) =~ s#.*\\##s;
is the same as
$bname = $fname; $bname =~ s#.*\\##s;

Replies are listed 'Best First'.
Re^2: Assign Contains RegEx WTF??
by eric256 (Parson) on May 21, 2009 at 14:12 UTC

    I just wanted to say thanks, I'd seen that before, and knew what it was and meant, but it never clicked before and this made it click! ;)


    ___________
    Eric Hodges

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (1)
As of 2024-04-16 00:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found