#@id = map{ $_->[0] } $dbh->selectall_array($sql,undef,'no') my $ref = $dbh->selectall_arrayref($sql,undef,'no'); @id = map{ $_->[0] } @$ref;