#!/bin/perl -w $p= "horraen=sumsel\[13\]\)\n"; $m="sumsel\[13\]"; print join("","this is \$m:",$m,"\n"); print $p; if ($p=~m/en=$m\)/) {print "yeah!\n";} else {print "why isn't it matching?\n";} $m=~s/\[/\\\[/g; $m=~s/\]/\\\]/g; print join("","this is \$m:",$m,"\n"); if ($p=~m/en=$m\)/) {print "yeah!\n";} else {print "what will I do now?\n";}