madM has asked for the wisdom of the Perl Monks concerning the following question:
sub Matrix { foreach my $key (@aminos){ foreach my $key2 (@aminos){ $matrix->{$key}->{$key2}= $ratesfromfreq->{$key}->{$key2}* +$factor; } $matrix->{$key}->{$key} += (1-$factor); } sub printMatrix1 { my $matrix2; ($matrix2) = @_; foreach my $key (sort keys %$matrix2){ print $key." "x2; foreach my $key2 (sort keys %{$matrix2->{$key}}){ printf("%.5f ", $matrix2->{$key}->{$key2}); } print "\n"x2; } } my $P= Matrix(); printMatrix($P);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Parsing hash reference as argument for subroutine
by choroba (Cardinal) on Jan 06, 2014 at 11:48 UTC | |
by madM (Beadle) on Jan 06, 2014 at 12:31 UTC | |
|
Re: Parsing hash reference as argument for subroutine
by Eily (Monsignor) on Jan 06, 2014 at 11:54 UTC |