in reply to Loading file into memory

Hashes take more space, are a bit slower than arrays, but are easier to use with the keys, etc. With arrays, you will need to setup indices, and things might get confused if you get something out of place. What you want to do, is read the file line by line, regex each line to get the 3 variables, then load them into your hash.

If you are going to be doing it often, you may want to use dbmopen and make a db file, so you can skip the regexes on subsequent runs. You can also use Storable for this:

#!/usr/bin/perl use Storable; %hash = (1=>"one", 2=>"two", 3=>"three"); foreach $key (keys %hash) {print "$key => $hash{$key}\n"} print "###############################################\n"; store(\%hash, 'persistent-data.db'); # later on... #$href = retrieve('persistent-data.db'); # by ref %hashback = %{retrieve('persistent-data.db') }; # direct to hash foreach $key (keys %hashback){print "$key => $hashback{$key}\n"}

I'm not really a human, but I play one on earth Remember How Lucky You Are