Ok, replying to myself because I think I'm tracking down my problem or at least catching a glimpse of it.

I am daemonizing my program in the normal case, so I fork && exit near the top in the primary subroutine that is called if we are to run in daemon mode--but this fork comes after the log object construction. So I'm creating two of the log object, I think...

So I tried breaking out the check for starting in daemon mode, put the log object construction right after the check and before the actual daemonizing subroutine call. So I should have a global $log object throughout either daemon mode, or the non-daemon mode. But alas I still get the error when signalling the program to shutdown (but not immediately on run as I was before, thus the reason I think I'm catching a fleeting glimpse of what is going wrong).

I've commented out the 'undef $log' at the end of the program as a test, but no result...and $log is not going out of scope until the end of the program because it is a global object. So does this mean the DESTROY method is called /after/ all objects are already out of scope? That just doesn't seem correct.

So what am I missing? (I know I'm missing something, because it can't be that DESTROY is called after the object is already gone. Or am I just thinking too hard?)


In reply to Re: Re: Re: Objects and undefined values by SwellJoe
in thread Objects and undefined values by SwellJoe

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.