in reply to Re: How to populate a HASH using a FOR loop to a FUNCTION
in thread How to populate a HASH using a FOR loop to a FUNCTION
... populating the hash really takes just 1 line of code ...
E.g., for the given example data of the OP:
c:\@Work\Perl\monks>perl -wMstrict -MData::Dump -le "my @array = qw( sean connery george lazenby roger moore timothy dalto +n pierce brosnan ); my %myHash = @array; dd \%myHash; " { george => "lazenby", pierce => "brosnan", roger => "moore", sean => "connery", timothy => "dalton", }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: How to populate a HASH using a FOR loop to a FUNCTION
by Laurent_R (Canon) on Dec 25, 2014 at 11:40 UTC |