in reply to Help me understand this idiomatic hash from array code
As tybalt89 already said, Slices (and perhaps the Range Operators if you haven't come across that yet).
my @header_line = ('id', 'name', 'age'); @fields{@header_line} = (0 .. $#header_line); # is exactly equivalent to ($fields{id},$fields{name},$fields{age}) = (0,1,2);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Help me understand this idiomatic hash from array code
by adhrain (Sexton) on Jul 12, 2017 at 07:39 UTC |