in reply to Re: subroutines - passing hashes by reference
in thread subroutines - passing hashes by reference
sub calc_enthalpy { my ($hash, $enthalpy_hash) = @_; my (@common, @total); foreach (keys %$enthalpy_hash) { if (exists $hash->{$_}) { push @common, "$_ = ", $ +enthalpy_hash->{$_} * $hash->{$_}, "\n"; push @total, $enthalpy_h +ash->{$_} * $hash->{$_}, "\n"; } return (\@common, \@total); } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: subroutines - passing hashes by reference
by perlplexer (Hermit) on May 01, 2003 at 15:24 UTC |