use Storable qw(freeze thaw); use DBI; use Data::Dumper; use strict; use warnings; my $dsn = "DBI:mysql:database=test;host=foo"; my $dbh = DBI->connect($dsn, 'root', 'abcd', {RaiseError => 1}); #my $data = {'a'=>1, 'b'=>{'c'=>2, 'd'=>3}, 'e'=>[1,2,3]}; #my $frozen = freeze($data); #my $command = "insert into test(a,b) values(10,?)"; #my $sth = $dbh->prepare($command); #$sth->execute($frozen); my $command = "select b from test where a = 10"; my $sth = $dbh->prepare($command); $sth->execute(); my $result = $sth->fetchrow_arrayref(); my $data = thaw($result->[0]); print Dumper($data);