[Chapter 3] 3.2.73 hex
Author: Larry Wall, Tom Christiansen & Randal L. Schwartz
Date: 1999-07-02T01:50:42Z

#

| Chapter 3 Functions |

### 3.2.73 hex

    hex EXPR

This function interprets `EXPR` as a hexadecimal string and returns the equivalent decimal value. (To interpret strings that might start with `0` or `0x` see oct.) If `EXPR` 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 an ell, not a one.)

3.2.72 grep |  | 3.2.74 import