in reply to Re: s/// ignoring subexpressions with variable replacement patterns
in thread s/// ignoring subexpressions with variable replacement patterns

If you just change those single quotes to double quotes, then the value of $1 from the previous pattern will be interpolated before the next substitution ever happens. If you really want the "variable pattern" to behave the same as the "static pattern", you may want to do something like this:
$newname = 'foo-64-bar'; $oldpat = '-([0-9]+0-'; $newpat = q/'_'.$1.'_'/; $newname =~ s/$oldpat/$newpat/ee; print "variable patterns: $oldname becomes $newname\n";
That's two /e modifiers, and it's not particularly pretty, but it works. I'm sure there's probably a better way, though. :-)

-- Mike

--
just,my${.02}