in reply to Finding a good routine

I have several scalars I want to write to the database using Update. However, I need to format the scalars so that the special characters are not an issue.

Let DBI take care of it. You're double-escaping your data, which is probably not good.
I like to avoid quote() and use ? placeholders instead:

my $sth = $dbh->prepare('UPDATE foo SET bar = ?'); $sth->execute($variable);
This is like saying UPDATE foo SET bar='$variable', but with automatic proper escaping.

U28geW91IGNhbiBhbGwgcm90MTMgY
W5kIHBhY2soKS4gQnV0IGRvIHlvdS
ByZWNvZ25pc2UgQmFzZTY0IHdoZW4
geW91IHNlZSBpdD8gIC0tIEp1ZXJk