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