Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
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?
[erix]: how does one find out how to install a program like cvsgrep
[erix]: I mean, I suppose it's just the one file so I can download that
[erix]: Makefile.PL should tell me, probably

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (6)
As of 2017-06-22 16:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (524 votes). Check out past polls.