Next | Program Repair Shop | 269 |
We now have:
sub printout { for my $i (0 .. $#{$chain[1]}){ my $chars = ""; for (@chain) { next unless defined; $chars .= $_->[$i]; } if ($ct_scanout) { $chars =~ tr/01/LH/; } else { $chars =~ tr/X/0/; } print OUTFILE $ct_scanout ? "\n(ct_so\n" : "\n(ct_si $ct_si{tdi}\n", "$chars\n )"; } }
The final problem is the use of global variables
As before, it's easy to turn them into parameters
Next | Copyright © 2002 M. J. Dominus |