0xN .... interpret N as hexadecimal 0bN .... interpret N as binary N .... interpret N as octal #### The following will handle decimal, binary, octal, and hex in the standard Perl or C notation: $val = oct($val) if $val =~ /^0/;