For Programmers: Free Programming Magazines  


Home > Archive > PERL Programming > March 2004 > converting hex to decimal









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author converting hex to decimal
made-man

2004-03-18, 6:47 pm


Hi

Is there a perl module that will convert hexidecimal numbers to decimal
numbers ?

Regards

M



Julien CROUZET aka c2c

2004-03-18, 6:47 pm

made-man a formulé ce mercredi :
> Hi
>
> Is there a perl module that will convert hexidecimal numbers to decimal
> numbers ?
>
> Regards
>
> M


No need for modules.

perl

use strict;

my $hex = "1A";
my $dec = hex($hex);

print "\$dev = $dec\n\n";

$dev = 26


perldoc -f hex

--
Julien CROUZET aka c2c
Love Perl, C, PhP, Unix and nntp brain waste

made-man

2004-03-18, 6:47 pm

its okay....I figured it out myself.

need to use hex() .

M



"made-man" <moe6@lycos.co.uk> wrote in message
news:c39ssq$kv8$1$8300dec7@news.demon.co.uk...
>
> Hi
>
> Is there a perl module that will convert hexidecimal numbers to decimal
> numbers ?
>
> Regards
>
> M
>
>
>



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com