Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^3: Interpolation of capture buffers not working when regex stored in variable

by jacklh (Initiate)
on Jun 06, 2013 at 01:10 UTC ( #1037342=note: print w/replies, xml ) Need Help??


in reply to Re^2: Interpolation of capture buffers not working when regex stored in variable
in thread Interpolation of capture buffers not working when regex stored in variable

Here's the modified code for others reference:
use String::Interpolate qw( interpolate ); ...[snip]... # Method 4: worked! (not global) #my ($before, $after) = $regex =~ m{/(.*)/(.*)/}; #$filename = replace($filename, $before, sub {interpolate($after)},0); # Method 5: worked! (global) my ($before, $after) = $regex =~ m{/(.*)/(.*)/}; $filename = replace($filename, $before, sub {interpolate($after)},1);
  • Comment on Re^3: Interpolation of capture buffers not working when regex stored in variable
  • Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1037342]
help
Chatterbox?
[choroba]: Good morning, Monks!
[choroba]: WFH today

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (8)
As of 2017-10-18 07:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (243 votes). Check out past polls.

    Notices?