http://qs1969.pair.com?node_id=67192


in reply to Escaping MySQL password

The problem with the specific snippet you quote here is that double-quoting the string leads it being interpolated, thus;
$_ = "host|db_name|user|some@thing";
will result in $_ containing `host|db_name|user|some`, at the array `@thing` is undefined at this point in the code.
Try using single quotes instead.