Your options in the load_data
call include this:
data => @LoL_SVs
Whereas in the documentation it is described like this
data => [ \@Obs1, \@Obs2, \@Obs3, \@Obs4, \@Obs5 ],
You try to load an array, but the module expects an array ref (possibly of array refs). So when you try to pass an empty array as the scalar argument, it evaluates to 0
(because it contains 0 elements). Similar to:
my @bar;
my $foo = @bar; # @bar is empty, $foo is 0
print $foo->[0]; # Can't use string ("0") as ARRAY ref ...
Your problem may be resolved by passing the reference to @LoL_SVs
:
data => \@LoL_SVs
As a side note, it is good that you are using
use strict;
And I also hope that you are using
use warnings;
Without strict
and with variable names like @LoL_SVs
it is very easy to make typos such as @Lol_Svs
which leads to hard to detect bugs. Without using warnings
, such bugs would be even harder to find.