my $sth = $dbh->prepare('select stdout,stdin from stderr'); $sth->execute; my @field = @{$sth->{'NAME'}}; my %field = map { $field[$_] => $_ } (0..$#field); my $rows = $sth->fetchall_arrayref();