#!/usr/bin/perl use strict; use DBI; use Data::Dumper; my $wah = wah(); print @$wah; sub wah { my $dbh = new_dbh(); my @results; my $sth = $dbh->prepare("select s.show_name,sr.overview,sr.banner from shows s,series sr where s.seriesid=sr.seriesid;"); $sth->execute(); while (my @rows = $sth->fetchrow_array() ) { push @results,@rows, } return \@results; } sub new_dbh { my $dbh = DBI->connect("dbi:SQLite:dbname=shows.db","","", {RaiseError => 1, sqlite_unicode => 1}) or die "$DBI::errstr"; return $dbh; }