if($tmp2 =~ m/\'/) { $tmp2 =~ s/\'/\\\'/g; # escape the single quotes.. }