sleepingsquirrel has asked for the wisdom of the Perl Monks concerning the following question:
but if the regex is program generated then you have to create another string with the proper number of terms in it and eval it (or I suppose you could do something like @a=(\$1,\$2,...,\$100) before-hand an pray you never get more capturing parentheses). I'm sure it's possible to gin up something using @-,@+, and substr, but I'm thinking that there is probably a better, more DWIM path to enlightnment.s/$regex/@a=($1, $2, $3).../e;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Array of ($1, $2, ...) in replacement part of s///?
by ysth (Canon) on Jan 28, 2004 at 19:51 UTC | |
by flounder99 (Friar) on Jan 28, 2004 at 21:02 UTC | |
by diotalevi (Canon) on Jan 28, 2004 at 21:28 UTC | |
by flounder99 (Friar) on Jan 30, 2004 at 15:18 UTC | |
|
Re: Array of ($1, $2, ...) in replacement part of s///?
by hardburn (Abbot) on Jan 28, 2004 at 19:42 UTC | |
|
Re: Array of ($1, $2, ...) in replacement part of s///?
by BrowserUk (Patriarch) on Jan 28, 2004 at 21:06 UTC | |
by sleepingsquirrel (Chaplain) on Jan 28, 2004 at 21:33 UTC | |
by ysth (Canon) on Jan 28, 2004 at 21:51 UTC |