mr19 has asked for the wisdom of the Perl Monks concerning the following question:
Im pretty new to scripting with perl and i have a problem with stat and i don't understand why its not working..
The error is: Use of uninitialized value $mtime in string at test.pl line 10.The error shown points to print.
#!/usr/local/bin/perl -w use strict; use warnings; use File::stat; my $filename = "test.txt"; my $mtime = (stat $filename)[9]; print $mtime;
I just wanted to simply display the timestamp of that file
Thanks in advance
Michael
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Problem with file::stat
by Anonymous Monk on Jun 11, 2015 at 12:08 UTC | |
by mr19 (Initiate) on Jun 11, 2015 at 13:19 UTC | |
|
Re: Problem with file::stat
by Discipulus (Canon) on Jun 11, 2015 at 12:12 UTC | |
|
Re: Problem with file::stat
by thanos1983 (Parson) on Jun 11, 2015 at 12:24 UTC |