Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: comparing 2 file time date stamps

by GrandFather (Saint)
on Nov 04, 2014 at 02:03 UTC ( #1105963=note: print w/replies, xml ) Need Help??


in reply to comparing 2 file time date stamps

Are you sure both stat calls succeed? If you use strictures (use strict; use warnings;) you'll be getting "Use of uninitialized value" warnings. Given that you reprise the stat calls later why not do them up front and check success? Something like:

sub cftsain { # Copy the image file if not there or changed. my ($xxfn1, $xxfn2) = @_; my @dd = (0, $xxfn1, $xxfn2, (stat "$xxfn1")[9], (stat "$xxfn2")[9 +]); die "Can't stat '$xxfn1'. Maybe it's missing?" if ! defined $dd[3] +; if (!-e $xxfn2) { ...
Perl is the programming world's equivalent of English

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1105963]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2022-08-18 04:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?