Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Input validation for built-in hex function

by toolic (Chancellor)
on Aug 30, 2012 at 17:04 UTC ( #990798=perlmeditation: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    perl -w -E "say hex(q{x})"
    0
    
  2. or download this
    perl -w -E "say hex(q{t})"
    Illegal hexadecimal digit 't' ignored at -e line 1.
    0
    
  3. or download this
    sub hex2 {
        my $str = shift;
    ...
            die "hex2: No chars found after stripping leading 0x or x";
        }
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://990798]
Approved by lidden
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (9)
As of 2014-07-30 10:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (230 votes), past polls