alberto_zurita has asked for the wisdom of the Perl Monks concerning the following question:
Hi, I just got a crush curse in PERL, since I am working on small project. I am not familiar with PERL, but PHP.
I need to push data into the following PERL structure of hash-array combination. Basically I need to read from a spreadsheet values containing 'owner' information and link it to a specific directory. It can be done manually like this:
$directory{"owner1"}{0} = ["DIR1", "DIR2", "DIR3"]; $directory{"owner2"}{0} = ["DIR4", "DIR5", "DIR6"];
This works, but now I need to read it from the spreadsheet as the values come, and assign it to the specific 'owner' key Is there a way to push into a specific key? i.e:
This way it gets pushed into the specific array. Any help will be greatly appreciated. Thanks in advance.push @directory{"owner1"} $value
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Pushing into a hash of arrays
by Arunbear (Prior) on Mar 16, 2015 at 17:25 UTC | |
by alberto_zurita (Initiate) on Mar 17, 2015 at 19:51 UTC | |
|
Re: Pushing into a hash of arrays
by sapphirecat (Acolyte) on Mar 16, 2015 at 19:45 UTC | |
|
Re: Pushing into a hash of arrays
by crusty_collins (Friar) on Mar 16, 2015 at 18:50 UTC | |
|
Re: Pushing into a hash of arrays
by Mr. Muskrat (Canon) on Mar 17, 2015 at 18:47 UTC | |
|