use strict; use warnings; use feature 'say'; use DBD::SQLite; use Data::Dumper; # set up and populate an in-memory DB my $dbh = DBI->connect("dbi:SQLite:dbname=:memory:", undef,undef,{ RaiseError => 1 }); $dbh->do(q{ create table data( id integer primary key, last_name text, first_name text, role text) }); my $insert_sth = $dbh->prepare(q{ insert into data values (?,?,?,?); }); while ( my $record = ) { chomp($record); my @values = split(' ', $record); $insert_sth->execute(@values); } # Select everything (!) my $ref = $dbh->selectall_arrayref(q{ select * from data }, { Slice => {} }); say Dumper $ref; __END__ 1 Flintstone Fred Father 2 Flintstone Wilma Mother 3 Flinstone Pebbles Child 4 Flintstone Dino Pet 5 Rubble Barney Father 6 Rubble Betty Mother 7 Rubble Bam-Bam Child