![]() |
|
Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: covariance calculationby amir_e_a (Hermit) |
on Dec 28, 2009 at 18:54 UTC ( #814650=note: print w/replies, xml ) | Need Help?? |
What the other monks answered is correct, and here's a little addition: The names of the variables $arraylref and $array2ref are hints that both of them are supposed to be references to arrays. \@sales is an array reference: the @ stands for "array" and \ stands for "reference". @hits, on the other hand, is just an array, not a reference. Of course, you can't always count on variable names to hint at what they are supposed to be, but in this case it is correct. Another hint that both of these variables really need to be references is the usage of the arrow operator -> in the line $arraylref->[$i] * $array2ref->[$i]; The arrow operator is only used with references.
In Section
Seekers of Perl Wisdom
|
|