Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Double interpolation of captured substrings

by TedPride (Priest)
on Nov 17, 2004 at 10:26 UTC ( #408360=note: print w/ replies, xml ) Need Help??


in reply to Double interpolation of captured substrings

my $newstring = munge_string( 'one_two_three', '312' ); print $newstring; sub munge_string { $_ = $_[1]; split /[^a-zA-Z]+/, $_[0]; s/(\d)/$_[$1-1]/g; return $_; }
I'm assuming you don't want to modify the original strings. I'm also assuming that your words are divided on non-letter boundaries.


Comment on Re: Double interpolation of captured substrings
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://408360]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (7)
As of 2015-07-08 01:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (93 votes), past polls