Maybe you want to learn about how Perl manages memory? You don't need to manage memory yourself (as you would have seen by monitoring the memory usage of your program as it downloads some files).

Also, if you want to call a method on an object, it helps to read the documentation as to what methods are supported. Neither ->delete nor ->die nor ->gibberish are documented there to work, so what makes you think they should work?

As programs do not share memory in a way that both can modify it and see the modifications unless you make very specific preparations, you cannot pass Perl objects between programs (or "scripts" as you call them). Not even in Java can you do that, or at least, it would be just as clumsy as in Perl, by storing all payload data in a file on disk and then restoring the object from that payload data. I'm not sure what you intend to gain from such an approach.


In reply to Re: Memory Managment with Subroutines and Objects by Corion
in thread Memory Managment with Subroutines and Objects by Anonymous Monk

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.