http://qs321.pair.com?node_id=661823


in reply to Re: How to copy an array to a hash?
in thread How to copy an array to a hash?

This may be useful:

my $data = do { local $/ = undef; <INFILE> }; my %edit = split /=|\r\n/, $data;

Hashes are almost like arrays with odd element number. Since split is splitting on new lines and = signs, and you appear to have it this way, it will construct the hash for you.

Hope this helps.

Igor 'izut' Sutton
your code, your rules.