in reply to Optimizing a regex

$pt == "" and $pc == "" should use eq, not ==. == is for numerical tests.

What exactly are your looking to match? Would all things look a certain way, like:

pagetitle "My title"
or
$pagetitle "My title"

A good place to see a use of qr// is the Untaint.pm module, which uses it. But, it is basically like so:

my $qr = qr!\d{3}\s+\w!; if ($str =~ /$qr/) { .. etc... }

Also, see the Regex Quote-Like Operators sections in perlop. When you say you can't get it to work properly, what is not working? What have you tried?

Cheers,
KM