Click to See Complete Forum and Search --> : Map List To Hash(!)


rigadon
08-26-2004, 11:07 AM
probably quite an easy one this - i'm just trying to map the output of a function returning a list into the elements of a hash, so i can access them by name. i know you can't do it this way but just to demonstrate what i mean:

my $index{@header_fields} = @{$csv->fields};

i know i can do this using a for loop but i was hoping for a rather more elegant solution :)

cheers