in reply to matching + character in a file

If all you're doing is trying to match a '+', another way to do this would be with the index function:

#!/usr/bin/perl -w use strict; my $a = '123a+b456'; print "found\n" unless index($a, 'a+b') == -1;

I'm not entirely sure how efficient that is, though (but I have a suspicion it's more efficient than attempting a full regex match).