in reply to Confounded With A Simple Self-Made Perl Mod

I suspect you want:

$regr = regression->new($element_stats_hash{$element_name});

which I'm guessing is already a reference to a hash of your raw data.

It looks like you are going out of your way to make things complicated by wrapping \%{} around things that are already hash references. For example:

$raw_dataPtr = \%{$element_stats_hash{$element_name}{'raw_data'}}; $$raw_dataPtr{$time} = {$var};

would be much better as:

$element_stats_hash{$element_name}{'raw_data'}{$time} = {$var};

except that {$var} is wrong in any case. You really must use strictures (use strict; use warnings;)! With strictures that line would generate something like:

Odd number of elements in anonymous hash at noname.pl line 8.

Perl's payment curve coincides with its learning curve.