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