Thanks again for thinking about it at all, out loud or otherwise. :P

The 32kB is just something I saw somewhere about gzip streams. I don't remember where, I probably shouldn't have mentioned it.

If I do this (assume proper var scoping)–

gunzip \$data => \$out; print $out, $/;

–it will display something like–

<status>connected</status> ?R??0 ????l??????@? +U?&#1964;??/?%y???p???v?Po#[???-???x? >\'&#1000;??4'?V.6?6?&#1444;~5Y???0???C]?$?@m~OgQ?u&#451;8?Y?E?8<?Le?4 +?6??&#1644;&qd?x#1

Amended to–

$collected .= $data; gunzip \$collected, \$out; print $out, $/;

We get (it's ignoring the Accept and returning XML)–

<status>connected</status> <quote> <ask>166.29</ask> <asksz>500</asksz> <bid>166.26</bid> … </quote> ...

And then dies after awhile, it's inconsistent where but never sooner than 5kB in, with an "unexpected end" style message.

Adding this lets it run for—maybe, I didn't let it run that long—forever, but it's still stacking up an ever growing scalar and gunzipping the same data over and over–

$collected .= $data; gunzip \$collected, \$out, MultiStream => 1; print $out, $/;

I expect I will have to come up with seek/tell/truncate kind of solution to keep the data from growing forever that uses the MultiStream to reset itself automatically. Haven't had time to go back to it. I feel like this must be a solved problem and I'm just looking in the wrong place. :|


In reply to Re^4: Uncompress streaming gzip on the fly in LWP::UserAgent/WWW::Mechanize by Your Mother
in thread Solved: Uncompress streaming gzip on the fly in LWP::UserAgent/WWW::Mechanize by Your Mother

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.