r.joseph has asked for the wisdom of the Perl Monks concerning the following question:
Now, I KNOW there is a better way! And you want to know HOW I know there is a better way? Because if I ever have more than one of these cute little tags on a line, very odd things start to happen: sometimes it totally deletes the line, sometimes it only prints one, sometimes little elven creatures crawl out of my computer and start biting at my ankles (that's the worst).while (<TEMPLATE>) { s/<~([^>]*)~>/eval "\$$1"/egi; print; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Regex and HTML Question
by maverick (Curate) on Dec 20, 2000 at 11:11 UTC | |
|
Re: Regex and HTML Question
by repson (Chaplain) on Dec 20, 2000 at 11:21 UTC | |
|
Re: Regex and HTML Question
by mirod (Canon) on Dec 20, 2000 at 16:01 UTC | |
|
Re: Regex and HTML Question
by extremely (Priest) on Dec 20, 2000 at 13:29 UTC | |
|
Re: Regex and HTML Question
by dws (Chancellor) on Dec 20, 2000 at 12:48 UTC | |
|
Re: Regex and HTML Question
by Maclir (Curate) on Dec 21, 2000 at 02:01 UTC |