If I understand correctly, you want to extract the three bytes starting at offset 29. You can get those with substr and then unpack them. Since your file is binary, let's read the first 32 bytes only, by setting $/ to a reference to 32.
The conversion is done by unpack, according to the template given in its first argument. "Decimal" really has little to do with it. The decimal string is produced by the stringification of a numeric value.my @chars; { local $/ = \32; open my $fh, '<', $name or die $!; binmode $fh; local $_ = <$fh>; @chars = unpack 'CCC', substr $_, 29, 3; close $fh or die $!; } print "@chars", $/; # quoted only to put space between values
After Compline,
Zaxo
In reply to Re: Picking certain values to convert from binary to decimal
by Zaxo
in thread Picking certain values to convert from binary to decimal
by nadadogg
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |