From: david <[EMAIL PROTECTED]> > Jenda Krynicky wrote: > > > Are the $n variables accessible as an array as well? > > > > Currently I am using > > > > no strict 'refs'; > > ... > > ... ${$i} ... > > > > but I don't really like that. > > > > I know I can do > > > > @array = ($string =~ /regexp/); > > > > but I need to access the matched strings in the code in > > s/regexp/code/ge so this is not workable. > > > > So did I overpass anything? > > > > maybe i miss you point and your question. s/regexp/code/ge, the code > portion is not matched/search for Perl, it's purely a replacement > string(or expression with as many /eeee as you want).
OK. I thought the difference between "I need to access the matched strings in the code in s/regexp/code/ge" vs. "I need to access the strings matched in the code in s/regexp/code/ge" is big enough :-) This is a little like what I have: $text =~ s{$regexp}{ my $tagname = $1; my %params = ('' => '%'); my $i = 2; no strict 'refs'; while (defined ${$i}) { $params{${$i}} = ${$i+1}; ... $i+=2; } ... }ge The ${$i} and ${$i+1} is the thing I do not like. Jenda =========== [EMAIL PROTECTED] == http://Jenda.Krynicky.cz ========== There is a reason for living. There must be. I've seen it somewhere. It's just that in the mess on my table ... and in my brain I can't find it. --- me -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]