use DBI; use Data::Dumper; use strict; my $dbh = DBI->connect( qw(DBI:vendor:database:host user pass), {RaiseError=>1} ); # setting RaiseError to true will cause your script to # die with an error message from all database errors my $sth = $dbh->prepare(" select * from mp3.songs limit 200 "); $sth->execute; my $hashrow = $sth->fetchrow_hashref; print Dumper $hashrow; # or just print Dumper $sth->fetchrow_hashref;