in reply to Converting Hexadecimal to Decimal notation and vice-versa

I think pack could take care of this as well.

UPDATE: Here's an example1:

$int = unpack("N", pack("H8", substr("0" x 8 . "DEADBEEF", -8)));
$dec = sprintf("%d", $int);

Where DEADBEEF is your hex number.

1http://perl.active-venture.com/pod/perlfaq4-datanumber.html

mtfnpy

Replies are listed 'Best First'.
Re^2: Converting Hexadecimal to Decimal notation and vice-versa
by AnomalousMonk (Archbishop) on Oct 18, 2009 at 11:53 UTC
    But how does this apply to the big integers of the OP?
    >perl -wMstrict -le "my $int = unpack('N', pack('H8', '102030405060708090a0b0c0d0e0f')); my $dec = sprintf('%d', $int); print $dec; " 270544960

      Specify a different template for sprintf?

      mtfnpy

        Can you give an example?