in reply to Regex and HTML Question

To save myself nightmares I always worked out of a hash and skipped the extra eval and the dollarsigns... Others already noted your match issue. Me, I was even more careful and set rules on myself. I'm a pretty shifty fellow and I have to keep a close eye on me to keep from starting trouble. =)
#!/usr/bin/perl -w use strict; my %h = ( name=>"Mark", monk=>"extremely", typo=>"Weaknesses"); while (<DATA>) { s/<~([a-z][a-z0-9]*)~>/$h{$1}/g; print; } __DATA__ [<~monk~>|<~name~>] also wrote it like this: s/<~([a-z][a-z0-9]*)~>/exists $h{$1} ? $h{$1} : "<~$1~>"/eg; to expose <~typos-> and survive "-w" and "use strict". Try both lines!

--
$you = new YOU;
honk() if $you->love(perl)