http://qs321.pair.com?node_id=764943


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