if ($temp =~ /#/){ $temp =~ s/#$'//; } #### my $varaible = '[a-z]'; m/\Q$variable\E/ # matches literal [a-z], not a character class.