divya wrote:

I've a file with every line having 32 bits of binary data.
I need to convert every line data to hex data.


my $binary = '11101010101010101010101010101010';
my $int = unpack("N", pack("B32", substr("0" x 32 . $binary, -32)));
my $hex = sprintf("%x", $int );
print $hex;


HtH
WayPay


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to