use warnings; use strict; use Data::Dumper; use DBI; my $dbh = DBI->connect("dbi:SQLite:dbname=:memory:", undef, undef, { RaiseError=>1, AutoCommit=>1 } ); $dbh->do(q{ CREATE TABLE foobar ( foo TEXT, bar TEXT ) }); my $in = $dbh->prepare(q{INSERT INTO foobar (foo,bar) VALUES (?,?)}); $in->execute('a','b'); $in->execute('c','d'); my $cards = $dbh->prepare('SELECT * FROM foobar'); $cards->execute; while (my ($card) = $cards->fetchrow_array) { # OR #while (my $card = $cards->fetchrow_arrayref) { # BUT NOT #while (my ($card) = $cards->fetchrow_arrayref) { print Dumper($card); }