Alright, so I have been reading the perl docs stuff online about references for most of the day.
Most of it is for much easier stuff than Marshal had written in his example. On lines where Marshal uses references to a hash of hashes of arrays (I think???), could someone explain them to me I am not getting it?
For Example:
push @{$recordState{$record_id}{$OwnerOrWaiting}}, $_;
if ( @{$recordState{$recNum}{WAITING}} >= 1)
foreach my $line ( @{$recordState{$recNum}{WAITING}} )
I know that, lets say:
$myArray = \@array; is the same as @{$myArray}, which is referring to the array "@array"
-OR-
$myHash = \%hash is the same as %{$myHash}, which refers to the hash "%hash", I think????
Also, that square brackets after a reference is referring to an element in that array. Like this,
%{$myArray}[3] refers to the 4th element in the array it refers to.
And for a hash reference, keys %myHash is the same as, keys %{$myHash}.
Or what would be even more helpful, if you or anyone has some time, could you take Marshal's code and document it out to where a newbie could relate (i.e. comments before any of the more difficult lines)?
If this is too much trouble, I understand, it's alot of work. I mean I could just take the code and probably use it as is, but I really want to learn this stuff.
Extremely Thankful,
Matt
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.