in reply to matching the + character

Also to get rid of pesky characters like + in re's you could make a character class.

Another way to do it.

use strict; my $var1 = "a+b"; my $var2 = "a[+]b"; if ($var1 =~ /$var2/) { print "hey it matches \n"; } print "hey here \n";