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]; }
In reply to Re: $1 in variable regex replacement string
by tadman
in thread $1 in variable regex replacement string
by dvergin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |