in reply to unpacking - html re-encoding?

Can you confirm how you are the DBI module to do the insert into the database?

If you are there are two ways in which these sorts of things are handled. If you are binding parameters to statements, using bind_param() then the quoting is handled automatically. If you are using a variable in the SQL statement, then there is the handy quote() function:

use strict; use DBI; # set up variables stuff omitted my $dbh = DBI->connect( $connection_string, $user, $pass ); my $value_q = $dbh->quote( $value ); my $sth = $dbh->prepare( "INSERT INTO my_table VALUES ( $value_q ) " ); ## etc...

If you're not using DBI or DBIx, then you should check them out.

-- iakobski