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:
push @directory{"owner1"} $value
This way it gets pushed into the specific array.
Any help will be greatly appreciated.
Thanks in advance.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.