in reply to Re^7: Multiple queries on DBI corresponding to multiple csv files?
in thread Multiple queries on DBI corresponding to multiple csv files?

->selectall_arrayref() returns a reference to an Array of Arrays

[ [field1,field2,etc],[field1,field2,etc],[field1,field2,etc]] so you need the map to extract the first field from each record. Your query only returns one field but the structure is the same.

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