in reply to strange collision when calculating p-values using Statistics::TTest

Aside from the possibility that there is a bug in the Statistics::TTest module, my first observation would be that Statistics::TTest leaves behind some leftover junk possibly by using globals within the module. There is a faq for this, read perldoc -q clear where MJD shows how to clear out all temporary package variables.

Usually a module's author will typically stick to using an array or hash for storage in the module. MJD's scrubber gets them all, but you may only need something like this at the end of your loop, to undef your temp arrays.

foreach my $dataset (sort keys %datasets) { my $ttest = new Statistics::TTest; $ttest->load_data(\@{$datasets{$dataset}[0]},\@{$datasets{$dataset +}[1]}); print "$dataset - t_prob:\t$ttest->{t_prob}\n\n"; undef @$ttest; # clear out old array data undef %$ttest; # get old hash data }

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh
  • Comment on Re: strange collision when calculating p-values using Statistics::TTest
  • Download Code