Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I am stuck trying to convert this Hex string to decimal in perl:

Hex: 5840b200

Decimal: 11681880

I am trying to do this from Hex to Dec with pack & unpack without any luck. I used unpack on an ARGV initially to get a hex string:

while(<>){ $hex_string .= unpack("H*",$_); }

Replies are listed 'Best First'.
Re: Convert hex string from little endian to decimal
by kcott (Archbishop) on Apr 15, 2014 at 04:54 UTC
      That worked.
Re: Convert hex string from little endian to decimal
by AnomalousMonk (Archbishop) on Apr 15, 2014 at 04:23 UTC

    See hex.

    Update: Sorry, didn't see the bit about little-endianity. See also reverse.