> -       my $foo  = $!;
> +       my $foo  = 0 + $!;  # force numeric
>         my $errno = POSIX::errno();
>         print "not " unless $errno == $foo;
> -       print "ok ", 28 + $test, " # POSIX::errno(): $errno, \$!: $!\n";
> +       print "ok ", 28 + $test, " # POSIX::errno(): $errno, \$!: $foo\n";
>      }
>  }
>  
> [end]
> 
> I get 
> 
> not ok 28 # POSIX::errno(): 20, $!: 0
> 
> which I think means autoloading sets errno but isn't supposed to.  I suspect 
> it's doing a -d somewhere and leaving an errno of ENOTDIR laying about.  Hmm. 
> 

Well, $! is meant to be exactly errno so it seems that the magic is not
working or using POSIX::errno has set errno to something. Does it make a
difference if you define $foo after you set $errno?

-- 
Tim Jenness
JAC software
http://www.jach.hawaii.edu/~timj


Reply via email to