This has to be done in Perl:
I have integers on the order of e.g. 30_146_890_129 and 17_181_116_691 and 21_478_705_663.
These are supposedly made up of 6 bytes, where:
- bytes 0-1 : value
a
- bytes 2-3 : value
b
- bytes 4-5 : value
c
I want to isolate what value a
is. How can I do this in Perl?
I've tried using the >>
operator:
perl -e '$a = 330971351478 >> 16; print "$a\n";'
5050222
perl -e '$a = 17181116691 >> 16; print "$a\n";'
262163
But these numbers are not on the order of what I am expecting, more like 0-1000.
Bonus if I can also get values b
and c
but I don't really need those.
Thanks!