This function interprets
EXPR as an octal string and returns the
equivalent decimal value.
EXPR happens to start off with
it is interpreted as a hex
string instead.) The following will handle decimal, octal, and hex in
the standard notation:
$val = oct $val if $val =~ /^0/;
EXPR is omitted, the function interprets $_.
To perform the inverse function on octal numbers,
$oct_string = sprintf "%lo", $number;