#!/usr/bin/perl use warnings; use strict; use Storable qw(freeze thaw); use DBI "SQL_BLOB"; my $dbh = DBI->connect("dbi:SQLite:dbname=testlib.db","","",{RaiseError => 1}); my @books=( { 'ISBN' => '0596004788', 'Title' => 'Learning Perl Objects, References, and Modules' }, { 'ISBN' => '0596001320', 'Title' => 'Learning Perl, Third Edition' }, { 'ISBN' => '0596003137', 'Title' => 'Perl Cookbook, Second Edition' }, ); my $book_list = freeze(\@books); my $sth = $dbh->prepare("INSERT INTO BOOKS (BOOK) values (?)"); $sth->bind_param(1,$book_list,SQL_BLOB); $sth->execute; $sth->finish; $sth = $dbh->prepare( 'select * from BOOKS' ); $sth->execute(); my $book= $sth->fetchrow_array ; my $new_list = thaw($book); foreach(@{$new_list}) { print "$_->{'ISBN'} $_->{'Title'}\n"; } __END__ 0596004788 Learning Perl Objects, References, and Modules 0596001320 Learning Perl, Third Edition 0596003137 Perl Cookbook, Second Edition