At 7:39 PM -1000 11/7/01, Tim Jenness wrote:
>On Wed, 7 Nov 2001, Craig A. Berry wrote:
>
> > I think it's supposed to verify that dynaloading has
> > not set errno, but for us it does:
>
>Are you sure it's not meant to be testing that POSIX::errno equals the
>numeric value of $! ? Or is there another test for that somewhere?
>
>I think the value of errno is only meant to be believable immediately
>after a system call rather than after an indeterminate set of perl
>function calls.
Well, here's that complete test before my modifications:
{
for my $test (0, 1) {
$! = 0;
# POSIX::errno is autoloaded.
# Autoloading requires many system calls.
# errno() looks at $! to generate its result.
# Autoloading should not munge the value.
my $foo = $!;
my $errno = POSIX::errno();
print "not " unless $errno == $foo;
print "ok ", 28 + $test, "\n";
}
}
If I understand the comment correctly, it's saying that because
POSIX::errno depends on autoloading, it might corrupt itself if
autoloading sets errno. Therefore it's trying to make sure that
autoloading does *not* set errno, which, as you suggest, may not be a
reasonable expectation, but there it is. Am I reading this right?
--
____________________________________________
Craig A. Berry
mailto:[EMAIL PROTECTED]
"Literary critics usually know what they're
talking about. Even if they're wrong."
-- Perl creator Larry Wall