in reply to DBI with hash of arrays

That is not a Perl problem, but an SQL question.

You want to join two tables.

You will probably need something like:

SELECT DISTINCT first_table.number, record_ids FROM first_table, secon +d_table WHERE second_table.number = first_table_number;
Always let the database do as much work as possible: it will be more efficient and faster.

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James