in reply to LineFit.pm error due to undef value

RTFM!

$lineFit->setData(\@x, \@y)

Explaining why it should be like this is something probably best left to the tutorials.

A word spoken in Mind will reach its own level, in the objective world, by its own weight

Replies are listed 'Best First'.
Re^2: LineFit.pm error due to undef value
by jdporter (Paladin) on Nov 20, 2007 at 15:48 UTC

    I'll add (thought I expect this will go right over your head) that you don't even need to deref and reref the arrays:

    sub correlation { . . . my( $x_ref, $y_ref ) = @_; my $lfit = Statistics::LineFit->new(); $lfit->setData( $x_ref, $y_ref ); . . . }
    A reply falls below the community's threshold of quality. You may see it by logging in.