| Next | Program
Repair Shop ![]() |
245 |
sub cleanup {
s/^\s+|\s*\n+$//g;
tr/\t //d;
s/\n//g;
s/\\//g;
}
The input looks like:
chain "chain1" =
"00110011001100110011001100110011001100110011001100\
11001100110011001100110011001100110011001100110011\
00110011001100110011001100110011001100110011001100\
...
00110011001100110011001100110011001100110011001100\
1100110011001100110011001100110011001100110"
The output should be an array of just the 0s and 1s
sub cleanup {
my $i = shift;
my ($bits) = $i =~ /=\s*"(.*)"/m;
$bits =~ tr/01//cd;
return [ split //, $bits ]
}
| Next | ![]() |
Copyright © 2002 M. J. Dominus |