Close.. What I actually want to do is sort the 1st and 2nd values together, and then retrieve them in descending order.
Effectively "flattening" two of the array values together (for this project, the third and fourth values are irrelevant). I'm thinking maybe something like this (does this make sense? I'm not sure what the first line will give me exactly...):
@newarray = (@alldata{data}[0], @alldata{data}[1])
@maxref = sort { $b->{data} <=> $a->{data} } @newarray
am I getting closer?
PS: I think my newbie status combined with this 3-dimensional array/hash/array structure has caused my cerebral cortex to rupture and leak my sanity out into the aether. :-P
Signature void where prohibited by law.
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.