in reply to Matching a pattern in Regex

no one mentioned it yet, so here goes -- to avoid escaping the / in the regex, use s### (or similar) instead of s/// .. just adds one more tidbit of legibility. A trivial example:
my $s = "<foo>stuff</foo>"; #$s =~ s/<foo>(.*?)<\/foo>/<bar>$1<\/bar>/; $s =~ s#<foo>(.*?)</foo>#<bar>$1</bar>#; print $s;