#!/usr/bin/perl -w use strict; use DBI; my $dbh = DBI->connect('DBI:mysql:database=test', 'root', ''); $dbh->do('drop table if exists test2'); $dbh->do('create table test2 (xyzzy blob)'); undef $/; # Slurp mode my $before = ; $dbh -> prepare('insert into test2 values( ? )') -> execute($before); my $sth = $dbh -> prepare('select * from test2'); $sth -> execute; my ($after) = $sth -> fetchrow_array; print $before eq $after ? "Data has not changed\n" : "Data has changed!!\n"; __DATA__ \ = backslash \\ = two backslashes \\\ = three backslashes ' = a single quote '' = two single quotes \' = a backslash and a single quote " = a double quote \" = a backslash and a double quote '"' = a double quote within 2 single quotes