Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Challenge - Creative Way To Detect Alpha Characters

by Pragma (Scribe)
on Sep 13, 2004 at 23:59 UTC ( [id://390708]=note: print w/replies, xml ) Need Help??


in reply to Challenge - Creative Way To Detect Alpha Characters

Iterating is for wussies:
my @ALPHA; $ALPHA[ord $_]++ for 'a'..'z', 'A'..'Z'; sub hasalpha { my $str = shift; return $ALPHA[ord $str] if length $str < 2; my $pos = int rand length $str; return hasalpha(substr $str, 0, $pos) || hasalpha(substr $str, $pos) +; } print hasalpha('1231a21221');

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://390708]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2024-03-29 10:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found