my $hex = sprintf('%X', oct("0b$reverse_str"));
print FOUT "HEX FORMAT: $hex\n";
If the hexa value is 007E, it is printing only 7E. How to get a 4 bit hexa value printed in Perl?
You have to use %04X instead of %X.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With