in reply to Re: assigning arrays as values to keys of hash
in thread assigning arrays as values to keys of hash
Great post!
However, I am not convinced that your implementation would be more efficient than any of the "2 pass solutions".
I thought my response to the OP at Re: assigning arrays as values to keys of hash to be reasonable and importantly: understandable by the OP.
I think that sometimes PerlMonks fails new Perler's with overly complicated solutions that they can't understand or generalize.
This OP is a beginner, not by user name, but by his original code.
Your solution hides a foreach loop in terms of a map{} which does a lot of work. Shorter Perl code doesn't always mean "faster".
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: assigning arrays as values to keys of hash
by tybalt89 (Monsignor) on Sep 18, 2018 at 23:06 UTC | |
by Marshall (Canon) on Sep 18, 2018 at 23:50 UTC | |
|
Re^3: assigning arrays as values to keys of hash
by Anonymous Monk on Sep 18, 2018 at 22:45 UTC | |
by tybalt89 (Monsignor) on Sep 18, 2018 at 23:36 UTC | |
by Marshall (Canon) on Sep 18, 2018 at 23:33 UTC |