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
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|