Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #201479

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

From "Martin McCormick" <martin.m@suddenlink.net>
Newsgroups linux.debian.user
Subject Re: perl; Trying to get File::stat to work
Date 2018-10-20 14:30 +0200
Message-ID <wKYye-7C8-9@gated-at.bofh.it> (permalink)
References <wKPuV-2dg-1@gated-at.bofh.it> <wKQqZ-2Lu-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

perl; Trying to get File::stat to work "Martin McCormick" <martin.m@suddenlink.net> - 2018-10-20 04:50 +0200
  Re: perl; Trying to get File::stat to work Bob McGowan <ramjr0915@gmail.com> - 2018-10-20 05:50 +0200
    Re: perl; Trying to get File::stat to work "Martin McCormick" <martin.m@suddenlink.net> - 2018-10-20 14:30 +0200
  Re: perl; Trying to get File::stat to work Dave Sherohman <dave@sherohman.org> - 2018-10-20 10:20 +0200
  Re: perl; Trying to get File::stat to work David Christensen <dpchrist@holgerdanske.com> - 2018-10-21 06:40 +0200

csiph-web