Declare the hash outside the loop and then store the row as: $hashname{$columns[0]} = \@columns;.
Though that will really only let you check for the existence of a key and get the data for that key. Queries based on other columns will not be possible, getting the rows sorted by the ID neither, ... If you need anything more complicated than "give me the data for ID ...", use DBD::CVS/DBD::AnyData or import the data into DBD::SQLite.
Jenda
Enoch was right!
Enjoy the last years of Rome.
In reply to Re: store array as a hash
by Jenda
in thread store array as a hash
by luckysing
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |