sub mysql_quote { local $_ = shift;  defined $_ or return 'NULL';  s/\'/\\'/g;  s/\x0d/\\r/g;  s/\x0a/\\n/g;  return "'$_'"; }