use Data::Dumper; my %t; for my $i (0..63) { for my $j (0..63) { $t{sprintf "%03x", $i*64 + $j} = [$i, $j]; } } my $buf; my @bytes; while (read STDIN, $buf, 4096) { my $hex = unpack "H*" => $buf; while ($hex =~ /(...)/g) { push @bytes, @{$t{$1}}; } } print Dumper \@bytes;
In reply to Re: unpacking 6-bit values
by salva
in thread unpacking 6-bit values
by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |