in reply to Re: Set variables from m//
in thread Set variables from m//

Ah, perfect!

Won't the second example capture the wrong backreferences though?

As for the parens, I guess you're right; that will just force it into an array context unnecessarily, no?

Thanks!

Replies are listed 'Best First'.
Re^3: Set variables from m//
by ikegami (Patriarch) on Jun 24, 2009 at 02:50 UTC

    Won't the second example capture the wrong backreferences though?

    I don't see any backreferences.

    I don't see a problem. The first capture will be assigned to undef (i.e. dropped), the second will be assigned to $extension, the third will be assigned to $name.

    As for the parens, I guess you're right; that will just force it into an array context unnecessarily, no?

    I meant the parens around \s. It was like doing $z=($x)+($y); instead of $z=$x+$y;