Eshan_k has asked for the wisdom of the Perl Monks concerning the following question:
Hello Monks, I am beginner in perl. I am facing issue with storing multidimensional arrays as key value pairs. I have 3 arrays. Array1 is a key of Array2 and Array2 should be key for Array3. Can anyone help me with this? With my code below array1 has keys for array2 and is stored as key value pair. How can I do it for 3 arrays?
#!usr/bin/perl use Data::Dumper; my @array1 = 'A' .. 'E'; my @array2 = 1 .. 5; my @array3 = 'a' .. 'e'; my %hash; @hash{@array1} = @array2; print Dumper \%hash; ~
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Hashes of Hashes with Multidimensional array
by choroba (Cardinal) on Dec 15, 2016 at 12:07 UTC | |
by Eshan_k (Acolyte) on Dec 15, 2016 at 20:09 UTC | |
by Anonymous Monk on Dec 15, 2016 at 22:43 UTC | |
|
Re: Hashes of Hashes with Multidimensional array
by Discipulus (Canon) on Dec 15, 2016 at 12:44 UTC | |
by Eshan_k (Acolyte) on Dec 15, 2016 at 20:10 UTC | |
by Anonymous Monk on Dec 15, 2016 at 22:44 UTC | |
by Discipulus (Canon) on Dec 16, 2016 at 08:06 UTC |