Perl in a Nutshell

Perl in a NutshellSearch this book
Previous: Reference: grepChapter 5
Function Reference
Next: Reference: index
 

hex

hex hexnum

Converts a hexadecimal string hexnum into its equivalent decimal value. If hexnum is omitted, it interprets $_. The following code sets $number to 4,294,906,560:

$number = hex("ffff12c0");
To do the inverse function, use:
sprintf "%lx", $number;   # (That's a letter 'l', not a one.)


Previous: Reference: grepPerl in a NutshellNext: Reference: index
Reference: grepBook IndexReference: index

Library Navigation Links

Copyright © 2001 O'Reilly & Associates. All rights reserved.