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.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: How to copy an array to a hash?
by CountZero (Bishop) on Jan 11, 2008 at 07:33 UTC | |
by izut (Chaplain) on Jan 14, 2008 at 07:38 UTC | |
by CountZero (Bishop) on Jan 14, 2008 at 19:34 UTC |
In Section
Seekers of Perl Wisdom