To go the other direction requires you to do a little work. Perl doesn't come with a binary2decimal (or hex) converter, but you can write your own easily:my $bin = sprintf "%b", hex $hex;
sub bin2dec { my @bits = reverse split '', shift; my $num = 0; for( my $i=0; $#bits >= $i; ++$i ) { $num += 2 ** $i if $bits[$i] } return $num } my $hex = sprintf "%x", bin2dec( $bin )
In reply to Re: hex to bin
by Adam
in thread hex to bin
by Eureka_sg
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |