Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Double interpolation of captured substrings

by Arunbear (Parson)
on Nov 17, 2004 at 10:05 UTC ( #408353=note: print w/ replies, xml ) Need Help??


in reply to Double interpolation of captured substrings

Use array slicing:

my %patterns = ( 123 => [0,1,2], 312 => [2,1,0] ); my @matches = $string =~ m/$some_pattern/; return join '', @matches[@{$patterns{$patternkey}}];


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://408353]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (9)
As of 2014-12-28 04:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (178 votes), past polls