first comment is the the my $VAR ||= ... lines should just use the = operator and not ||= (since declaring the vars here, obvisouly they are undef so doing the equivalent of my $x = $x || ... doesn't gain anything).

do you have a use Time::localtime; statement in there? To debug, i would Data::Dumper the $ct, $mt, and $at variables and see what's in there. Maybe also dump $sb and $sb->ctime, $sb->mtime, and $sb->atime and hopefully that will reveal the problem.

Update: I see now that you (blackadder) posted this already here: Invalid File Handle??? and that my advice above is same as that given in that thread -- did you follow it? what were the results? I also see you posted that other thread just 3 hours ago .. why don't you wait a little longer before reposting the same issue?

In reply to Re: I am really stuck here....PLEASE HELP. by davidrw
in thread Invalid File Handle??? by blackadder

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.