Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
(FYI, what I actually have is a snippet that counts the number of backreferences in a pattern, and then concat's each backreference value into one string.)use warnings; use strict; #.... $_ = 'foobarbaz'; my $backrefcount = 3; /(f.o)(b.r)(b.z)/; foreach (1..$backrefcount) { no strict; print ${$_}."\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: accessing backreferences
by merlyn (Sage) on Mar 09, 2001 at 23:03 UTC | |
by YaRness (Initiate) on Mar 15, 2001 at 01:32 UTC | |
|
Re: accessing backreferences
by arturo (Vicar) on Mar 09, 2001 at 23:05 UTC | |
by YaRness (Initiate) on Mar 15, 2001 at 01:36 UTC | |
|
Re: accessing backreferences
by YaRness (Initiate) on Mar 09, 2001 at 23:02 UTC | |
|
Re: accessing backreferences
by InfiniteSilence (Curate) on Mar 09, 2001 at 23:21 UTC | |
by merlyn (Sage) on Mar 09, 2001 at 23:23 UTC |