madM has asked for the wisdom of the Perl Monks concerning the following question:
sub printMatrix1 { my ($A,$forprint,$header1) = @_; #$A is the matrix to be printed, +$forprint is the format and $header1 is the header of the matrix to b +e printed open(OUT,">$header1.txt") or die "The File $header1.txt couldnīt b +e opened\n"; print OUT "$header1\n\n"; print OUT ' '; #prints space first so + that upper letters stay formated in place my $format2= $forprint; substr ($format2,length($format2)-1,1,'s'); #### for printing uppe +r letters in the matrix foreach my $key (@aminos){ #Prints Upper aminoacido lette +rs of the Matrix printf OUT ("$format2 ", $key); } print OUT "\n"; foreach my $key (@aminos) { print OUT $key,' '; foreach my $key2 (@aminos ) { printf OUT ("$forprint " , $A->{$key}->{$key2}); } print OUT "\n"; } close OUT; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: updating code with getopt::long
by toolic (Bishop) on Mar 19, 2014 at 15:36 UTC |