Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Input validation for built-in hex function

by toolic (Bishop)
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 lurking in the Monastery: (12)
As of 2015-07-29 16:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (265 votes), past polls