Hi Monks !
I am using the modules Safe and Safe::Hole in order to execute code I am getting from external resources.
The same Perl code is going in a loop over a list of files, execute each of them, and this way check it plus minus.
As long as the code being executed is straight Perl script there is no problem, but this is the behavior when the script uses external modules -

The bottom line is -
I need to find a way to clean every piece of memory used by a former executed script in the Safe compartement in order to execute the script after it. It looks as though I will need to clean the name space itself and not the Safe object, and any new name spaces created while the script is being executed.
Since Perl's garbage collector, as far as I know, is being executed automatically without any way to force it, it seems I need to find a way to know what "data" Perl has in his memory a in order to "undef" it one by one.

Questions are -

I don't see any specific reason to send any code, but if it is necessary I will gladly do it.

Thanks all,
shushu

In reply to Safe.pm and memory problems by shushu

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.