my $query = $dbh->prepare("SELECT * FROM items ORDER BY created ASC"); $query->execute(); while ( my $h_fields = $query->fetchrow_hashref() ) { next if $h_fields->{status} eq 'no'; # not needed with WHERE clause ... } #### $ary_ref = $sth->fetchrow_arrayref; $ary_ref = $sth->fetch; # alias