akm2 has asked for the wisdom of the Perl Monks concerning the following question:
My fellow monks, I sit before you with my head hung in shame. I have nearly been beaten. Below was intended to be a simple regular expression to replace $var or $var[0] or $var{hashname} or $var{'hashname'} or $var{"hashname"} with the correct value.
$HTMLLine =~ s/(\$[\w\[\]{}']+)/'"'.$1.'"'/gee;
The above line works fine on $var but won't work on anything else.
Any help would be great!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: expanding scalar content
by princepawn (Parson) on May 19, 2001 at 00:32 UTC | |
|
Re: expanding scalar content
by Sifmole (Chaplain) on May 19, 2001 at 01:08 UTC | |
|
Re: expanding scalar content
by srawls (Friar) on May 19, 2001 at 01:12 UTC | |
|
Re: expanding scalar content
by tadman (Prior) on May 19, 2001 at 03:02 UTC | |
by srawls (Friar) on May 19, 2001 at 03:27 UTC |