in reply to Re: Re: Re: $1 in variable regex replacement string
in thread $1 in variable regex replacement string
As far as I can tell, you're only using %seen to count?sub safeswitch { no strict 'refs'; my @P = map { $$_ } 0..@+; $_[0] =~ s/\$(\d+)/$P[$1]/g; $_[0]; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: $1 in variable regex replacement string
by belden (Friar) on Feb 15, 2003 at 01:01 UTC |