in reply to subroutines - passing hashes by reference

Aha, your problem there is that you are treating a scalar has reference as a hash, however they are two distinct things. What you need to be doing is dereferencing your hash reference when using it e.g
foreach (keys %$enthalpy_hash) { if(exists $hash->{$_}) { push @common, "$_ = ", $enthalpy_hash->{$_} * $hash->{$_}, "\n"; push @total, $enthalpy_hash->{$_} * $hash->{$_}, "\n"; } }
See. tye's References quick reference and the venerable perlref for more info on references and dereferencing in perl. On a side note the likes of strict will catch this sort of error upon a simple perl -c.
HTH

_________
broquaint