This error
Can't locate package AutoLoader for @Math::Round::ISA
is still happening, but it isn't straightforward to reproduce.
I suspect some property of the @ISA cache has changed since Perl 5.14
but I haven't investigated.
For the test script attached I don't know whether the threads are
necessary, but this is the smallest reduction I found of the case
where I met the error.
$ for p in /usr/bin/perl perl-5.14.2 perl-5.14.4 perl-5.16.2 perl-5.16.3 perl-5.18.0 perl-5.18.1 perl-5.8.9; do $p /tmp/isa.pl; done
[w] In 0, /usr/bin/perl is 5.014002 at /tmp/isa.pl line 9.
Foo=HASH(0x1c0a360)
[w] In 0, threads=SCALAR(0x1ae12f0)->error = (nil) at /tmp/isa.pl line 14.
This Perl not built to support threads
Compilation failed in require at /tmp/isa.pl line 4.
BEGIN failed--compilation aborted at /tmp/isa.pl line 4.
[w] In 0, /software/perl-5.14.4/bin/perl is 5.014004 at /tmp/isa.pl line 9.
Foo=HASH(0x1d456e0)
[w] In 0, threads=SCALAR(0x1ccadc8)->error = (nil) at /tmp/isa.pl line 14.
[w] In 0, /software/perl-5.16.2/bin/perl is 5.016002 at /tmp/isa.pl line 9.
[w] In 1, Can't locate package AutoLoader for @Math::Round::ISA at /tmp/isa.pl line 10.
[w] In 1, Can't locate package AutoLoader for @Math::Round::ISA at /tmp/isa.pl line 10.
Foo=HASH(0x1938c40)
[w] In 0, threads=SCALAR(0x18c05f8)->error = (nil) at /tmp/isa.pl line 14.
[w] In 0, /software/perl-5.16.3/bin/perl is 5.016003 at /tmp/isa.pl line 9.
[w] In 1, Can't locate package AutoLoader for @Math::Round::ISA at /tmp/isa.pl line 10.
[w] In 1, Can't locate package AutoLoader for @Math::Round::ISA at /tmp/isa.pl line 10.
Foo=HASH(0xffb070)
[w] In 0, threads=SCALAR(0xf8d308)->error = (nil) at /tmp/isa.pl line 14.
[w] In 0, /software/perl-5.18.0/bin/perl is 5.018000 at /tmp/isa.pl line 9.
[w] In 1, Can't locate package AutoLoader for @Math::Round::ISA at /tmp/isa.pl line 10.
[w] In 1, Can't locate package AutoLoader for @Math::Round::ISA at /tmp/isa.pl line 10.
Foo=HASH(0x1b4b560)
[w] In 0, threads=SCALAR(0x1ad72c0)->error = (nil) at /tmp/isa.pl line 14.
[w] In 0, /software/perl-5.18.1/bin/perl is 5.018001 at /tmp/isa.pl line 9.
[w] In 1, Can't locate package AutoLoader for @Math::Round::ISA at /tmp/isa.pl line 10.
[w] In 1, Can't locate package AutoLoader for @Math::Round::ISA at /tmp/isa.pl line 10.
Foo=HASH(0x2927080)
[w] In 0, threads=SCALAR(0x27e39b0)->error = (nil) at /tmp/isa.pl line 14.
[w] In 0, /software/perl-5.8.9/bin/perl is 5.008009 at /tmp/isa.pl line 9.
Foo=HASH(0x2111950)
[w] In 0, threads=SCALAR(0x1d64ae0)->error = (nil) at /tmp/isa.pl line 14.
My workaround is "use AutoLoader;" before "use Math::Round ...;" .
--
Matthew
--
The Wellcome Trust Sanger Institute is operated by Genome Research
Limited, a charity registered in England with number 1021457 and a
company registered in England with number 2742969, whose registered
office is 215 Euston Road, London, NW1 2BE.
#!/usr/bin/perl
use strict;
use warnings;
use threads;
$SIG{__WARN__} = sub { my $tid = threads->tid; warn "[w] In $tid, @_" };
print "\n\n";
warn "$^X is $]";
my $t = threads->create(\&thr);
sleep 2;
$t->join;
my $e = $t->error || '(nil)';
warn "$t->error = $e";
exit 0;
sub thr {
my $o = Foo->new;
print $o, "\n";
}
package Foo;
use Math::Round qw(nhimult);
sub new {
return bless {}, __PACKAGE__;
}