in reply to Re: Invalid File Handle???
in thread Invalid File Handle???

Thanks,...How can I check my windows 2000 desktop to see if it can support atime?

Also, Not sure on how to use this notation $at ||=localtime! can I just use it in my code as
my $at ||= localtime $sb->atime;
Is the above correct?

or this is correct?
my $at = localtime $sb->atime || 'UNKNOWN';
Thanks for the enlightenment.
Blackadder

Replies are listed 'Best First'.
Re^3: Invalid File Handle???
by Corion (Patriarch) on Jul 13, 2005 at 12:25 UTC

    The problem originates from the fact that seemingly, the following code does not return an object:

    my $at = localtime $sb->atime;

    You could print out the result of $sb->atime, or look into the documentation of the module to find out how it behaves on your Windows 2000 desktop.

    As you are using $at as an object later on, you want to synthetize an object for the "unknown" value as well. As I don't know what kind of module you are using that overrides localtime, I can't offer much more help here.

      *cough*

      use Time::localtime;

      --
      We're looking for people in ATL

Re^3: Invalid File Handle???
by thundergnat (Deacon) on Jul 13, 2005 at 15:23 UTC

    Probably not much help, but a confirmation, this script seems to work fine on my Win2K machine. No errors, reasonable results... Tested on Win2K, NTFS and Fat32 file systems, ActivePerl 5.8.6 build 811.