Next | Program Repair Shop | 266 |
sub printout { for my $i (0 .. $#{$chain[1]}){ my $chars = ""; for (@chain) { if ($ct_scanout) { $_->[$i] =~ tr/01/LH/; } else { $_->[$i] =~ tr/X/0/; } $chars .= $_->[$i]; } print OUTFILE $ct_scanout ? "\n(ct_so\n" : "\n(ct_si $ct_si{tdi}\n", "$chars\n )"; } }
Now an inspiration:
Why do the trs one character at a time?
tr can transform $chars all at once!
Next | Copyright © 2002 M. J. Dominus |