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

2018-10-20 Thread David Christensen
On 10/19/18 7:47 PM, Martin McCormick wrote: #!/usr/bin/perl -w use strict; use warnings::unused; use File::stat; use File::Spec; my $last_update_time; $last_update_time = ( stat("testfile") )[9]; printf("%d\n",$last_update_time); My system: 2018-10-20 20:59:53 dpchrist@vstretch

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

2018-10-20 Thread Martin McCormick
Bob McGowan 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

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

2018-10-20 Thread Dave Sherohman
On Fri, Oct 19, 2018 at 09:47:11PM -0500, Martin McCormick wrote: > I am a member of a perl discussion list but it seems to have gone > away Your actual question has already been answered, but, for future reference, PerlMonks (https://www.perlmonks.org/) is still around and there are also several

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

2018-10-19 Thread Bob McGowan
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

perl; Trying to get File::stat to work

2018-10-19 Thread Martin McCormick
I am a member of a perl discussion list but it seems to have gone away so I hope somebody here can give me an idea as to why the stat function is not working. Create a file called testfile in your working directory and then run the following perl script: #!/usr/bin/perl -w use strict;