The stat builtin is always implemented, so no need for an eval {} test to
check for this. The presence or absence of <sys/stat.h> at the C level isn't
going to affect the outcome of this test.
Both have been in the test script since it was added (as t/lib/filestat.t)
by commit
f7a45afb043dafc5 in May 2001. I suspect that both were copied
from one of the Net::* test scripts which was being used as the template.
$file = readlink $file;
die "Can't readlink(../lib/File/stat.t): $!" if ! defined $file;
}
-
- our $hasst;
- eval { my @n = stat $file };
- $hasst = 1 unless $@ && $@ =~ /unimplemented/;
- unless ($hasst) { plan skip_all => "no stat"; exit 0 }
- use Config;
- $hasst = 0 unless $Config{'i_sysstat'} eq 'define';
- unless ($hasst) { plan skip_all => "no sys/stat.h"; exit 0 }
}
# Originally this was done in the BEGIN block, but perl is still