Midnite has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

I'm looking for a way to pull the 'date modified' from the file I use in a script. I found on way, but I need to use Date::Manip;.

But, since I am not the admin, it may not be possible. Is there another way I can get? Or, does anyone know how to convert the epoch seconds to a real value, easily readable?

Joseph A. Ruffino
Automated Systems Assistant
Gail Borden Public Library District
270 N. Grove Ave
Elgin, Il, 60120
847-742-2411 x5986
jruffino@nsls.info

Replies are listed 'Best First'.
Re: File Date
by sweetblood (Prior) on Jul 29, 2004 at 22:14 UTC
      Concerning same subject, I'm looking for a way to compare 2 versions of a same file locatted in different folders just by using common Perl libraries. What is the best way from your advice? BR, Stephane
        I've used Algorithm::Diff successfully for tracking changes in files.
        لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
Re: File Date
by Limbic~Region (Chancellor) on Jul 29, 2004 at 22:30 UTC
    Midnite,
    You can use POSIX 'strftime';, which is part of the core. Chances are, print scalar localtime( timestamp ); will be sufficient. FWIW - perldoc -f stat since you seem to be asking two questions, how to get the modified stamp and then format it.

    Cheers - L~R

      L~R,

      Thank you very much. I learned more today. I am not new to perl, but, gladly, I am still leraning it. Though this one as my boss says, is way 'geeky' ;)

      Joseph A. Ruffino
      Automated Systems Assistant
      Gail Borden Public Library District
      270 N. Grove Ave
      Elgin, Il, 60120
      847-742-2411 x367
      jruffino@nsls.info