> Hi,
>
> I am so confused the time output result.
>
> Time::tm=ARRAY(0x109c3b0)
>
>
> Here is the code:
>
> #!/usr/bin/env perl
>
> use strict;
> use warnings;
> use autodie qw(open close);
> use 5.012;
> use Time::localtime;
> use File::stat;
>
> open my $fh, '<', "too0.tex";
>
> my $time = localtime;
>
> my $modtime = ctime(stat($fh)->mtime);
>
> say $modtime;
> say $time;
>
> How can I make it work.
>
> I just to wish to check the time interval of the  modified  $fh,
> I mean how many hours has been passed since the file being last time
> modified.


# perldoc Time::localtime;


I just rewrote your script, you will get the idea after reading the doco


===============================================

#!/usr/bin/env perl

use strict;
use warnings;
use autodie qw(open close);
use 5.012;
use Time::localtime;
use File::stat;

open my $fh, '<', "too0.tex";

my $modtime = ctime( stat($fh)->mtime );
say $modtime;
printf "Year is %d\n", localtime->year() + 1900;

=================================================


 --
Owen


-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to