[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: perl; Trying to get File::stat to work



Bob McGowan <ramjr0915@gmail.com> writes:
> It looks like this has to do with mixing the usage of the "native" stat of
> Perl with the "object" version from File::stat.
> 
> 
> 
> The 'stat' from File::stat returns a reference to an object, which has the
> stuff you're wanting, tucked away internally as object variables.  You 
> need
> to do:
> 
> 
>     use File::stat;
> 
>     $statRef = stat('testfile');
> 
>     $mtime = $statRef->mtime ()
> 
> Hoping this helps.
> 
> Bob

Thank you and thanks to Dave Sherohman <dave@sherohman.org>  He
wrote:

> Your actual question has already been answered, but, for future
> reference, PerlMonks (https://www.perlmonks.org/) is still around and
> there are also several Perl folks who frequent StackOverflow
> (https://stackoverflow.com/), so you can generally get good answers to
> Perl questions pretty quickly from either of those sites.

	It worked perfectly plus I now much better understand how
the pieces all fit together.

Martin


Reply to: