[ create a new paste ] login | about

Link: http://codepad.org/hD9fRKod    [ raw code | output | fork ]

proch - Perl, pasted on Mar 27:
boxprint("
My program v. 1.0

Parameters:
FASTA-filename Coverage ReadLength");


sub boxprint {
 my $max;
 my $string = $_[0];
 @lines = split (/\n/, $string);
 foreach $l (@lines) {
   $max = length($l) if ($max<length($l));
 }
 $sep = '-' x ($max);
 print '+-'.$sep."-+\n";
 foreach $l (@lines) {
   $cur = length($l);
   $space=' ' x ($max-$cur);
   $l = '| '.$l.$space.' |';
   print "$l\n";
 }
 print '+-'.$sep."-+\n";
}


Output:
1
2
3
4
5
6
7
+------------------------------------+
|                                    |
| My program v. 1.0                  |
|                                    |
| Parameters:                        |
| FASTA-filename Coverage ReadLength |
+------------------------------------+


Create a new paste based on this one


Comments: