Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Assign Contains RegEx WTF??

by ikegami (Patriarch)
on May 19, 2009 at 15:25 UTC ( #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? | Other CB clients
Other Users?
Others perusing the Monastery: (2)
As of 2023-06-09 00:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How often do you go to conferences?






    Results (35 votes). Check out past polls.

    Notices?