I think you're being bugged by the typical problem that releasing contents of variables doesn't release the memory back to the OS. That only happens when the program quits.

You don't seem to be in a hurry. Why not just restart the program? This script shows the concept:

use appiqcli; my @eventlist = appiqlist(-event -all); sleep(10); exec $^X, $0;
You may have to add any extra parameters.

Note: $^X is the full path to the current perl interpreter, $0 is the name of the script. And yes, it works on Win32.

You can watch out for a keypress in that sleeping period, and not do the exec statement if you see one. Or, just have the user press ctrl-C.


In reply to Re: break out of enless loop does not release memory by bart
in thread break out of enless loop does not release memory by PugSA

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.