Help for this page
5 -6 8 10 12 3 10 0 0 0 0 0 0 1 = 10 ... 0 0 0 0 1 0 1 = 12, 10 ... 1 1 1 1 1 1 1 = 5, -6, 8, 10, 12, 3, 10
#!/usr/bin/perl use strict; ... my $total = sum( map {$bit[$_] ? $amount[$_] : 0 } 0 .. $#bit); print "$total\n"; }