push @$allshows, $shows; #### for (@ids) { my $stmt = "SELECT * FROM shows WHERE id = '$_'"; &execute_it( $stmt ); #sub that prepares and executes while (my $shows = $sth->fetchall_arrayref({})) { push @$allshows, $shows); } }