This never ending project I am working on needs a new function; sorting and filtering responses. The web gui is a RoR app that I hardly know how it works, but trying to learn cause I think it's neat. :) Basically, When a parameter is passed to the perl script, it builds an XML response on the fly and pushes it back, where the ruby builds a table to display in a web browser. Some of the responses can be huge, so I would like the script to write the data to a cache, and allow the ruby to read from the cache instead of the XML response. Which perl mod would I want to use? I would use something like this in conjunction with some sort of caching? And if they re-run the report, new parameter(s) would be passed back to the perl script saying "hey let's sort this column, let's only display results where the data in this column starts with a T, and make sure we read from this file cache" Basically I create XML like this:
while LOOP{ BUNCH OF MATH STUFF .... .... push @output, $xml->cdr( $xml->Date($date_time), $xml->IngressTG($orig_gw), $xml->EgressTG($term_gw), $xml->Dialed($call_dtmf), $xml->DUR($duration), $xml->PDD($hold_time), $xml->ISDN($isdn), $xml->CallType($call_type), $xml->Link( "../cgi-bin/rpt.pl?name=CDRDETAIL&begdate=$begindate&enddate=$enddate& +interval=$interval&item2=$call_id" ) ); } print "<dataset name=\"$hdr\">\n"; print @output; print "</dataset>";
So instead of just printing it, writing it to a file cache. More than one person uses this app at a time, so I would imagine the cache it writes to would have to have some kind of identifier so we know what session it belongs to. Does this make sense? What would you use?

In reply to Cache, sort, and filter XML response by hallikpapa

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.