in reply to Re: s/// ignoring subexpressions with variable replacement patterns
in thread s/// ignoring subexpressions with variable replacement patterns
That's two /e modifiers, and it's not particularly pretty, but it works. I'm sure there's probably a better way, though. :-)$newname = 'foo-64-bar'; $oldpat = '-([0-9]+0-'; $newpat = q/'_'.$1.'_'/; $newname =~ s/$oldpat/$newpat/ee; print "variable patterns: $oldname becomes $newname\n";
-- Mike
--
just,my${.02}
|
|---|