Has anyone try to delay loading the Statistics module by using autouse? I can't get it to work.

The usual usage without autouse is this:
use Statistics::Descriptive;
$stat = Statistics::Descriptive::Sparse->new();

But if I autouse with this syntax:
use autouse 'Statistics::Descriptive';
$stat = Statistics::Descriptive::Sparse->new();

I get this error:
Can't locate object method "new" via package "Statistics::Descriptive::Sparse" (
perhaps you forgot to load "Statistics::Descriptive::Sparse"?) at C:\Perl\prog\b
io1a\test.pl line 2.


------------

If I change the syntax to this:
use autouse 'Statistics::Descriptive::Sparse';
$stat = Statistics::Descriptive::Sparse->new();

I still get the same "can't locate object method 'new'" error.

------------

I tried changing it to:
use autouse 'Statistics::Descriptive' => 'Sparse';
$stat = Statistics::Descriptive::Sparse->new();

I got the same "can't locate object method 'new'" error.

------------

I tried changing it to:
use autouse 'Statistics::Descriptive' => 'Statistics::Descriptive::Sparse';
$stat = Statistics::Descriptive::Sparse->new();

This time I get a different error:
autouse into different package attempted at C:\Perl\prog\bio1a\test.pl line 1
BEGIN failed--compilation aborted at C:\Perl\prog\bio1a\test.pl line 1.

------------

Any idea what should be the correct way?


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to