micronx2 has asked for the wisdom of the Perl Monks concerning the following question:
This works: $curline = '...[$variable]...'; # example 1 $curline =~ s/\[\$(.+?)\]/$$1/g; This doesn't: $curline = '...[$hash{'constant'}]...'; # example 2 $curline =~ s/\[\$(.+?)\]/$$1/g;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Regex Variable Substitution
by Prior Nacre V (Hermit) on Aug 06, 2004 at 21:29 UTC | |
|
Re: Regex Variable Substitution
by ysth (Canon) on Aug 06, 2004 at 21:34 UTC |