use warnings; use strict; my $str = 'ABCD'; while (my $mask = <DATA>) { chomp $mask; for my $i (0 .. length($mask)-1) { print substr($str, $i, 1) if substr($mask, $i, 1) eq '1'; } print "\n"; } __DATA__ 1001 1110 0101 0001
In reply to Re: Reading Binary
by toolic
in thread Reading Binary
by BoulderBuff64
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |