Hi, my mastery of Perl is much like Tarzan's mastery of English, so please bear with me if I seem a bit ignorant.
I'm using the rss2html.pl script available with the XML::RSS module to print out RSS news items out of our site into HTML. The problem is that we want to be able to sort by category and by date. The issue is that the data is stored in a bunch of multi-dimensional hashes, and I'm trying to work out the best strategy to output the information.
The cast of characters includes:
- $rss->{item} -- an individual RSS news item
- $rss->{item}->(rss 1.0 information} -- the usual RSS1.0 tags like <description>, <title>, etc
- $rss->{item}->{nzgls}->{nzgls tags} -- tags from the New Zealand Government Locator Service namespace, including identifier, a string containing date information, which is what I want to sort the items by.
The best strategy I've figured out is to push each item's hash values into an array, push this array into a parent array, and then sort the parent array by the nzgls:identifier info. However, when I try doing this I get errors about turning hashes into arrays. I get the feeling I'm trying to do something that Perl isn't designed to do.
Any ideas? Thanks for reading this far!
Cheers
Stuart
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.