Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Challenge - Creative Way To Detect Alpha Characters

by TheEnigma (Pilgrim)
on Sep 13, 2004 at 18:12 UTC ( [id://390630]=note: print w/replies, xml ) Need Help??


in reply to Challenge - Creative Way To Detect Alpha Characters

I'm not sure I understand. Do you want to do something only if there are no alpha characters? Because isn't that what

if ( lc $foo eq uc $foo ) { }

would do?

I just want to make sure I understand the condition of the challenge, not that I'm up to it ;)

TheEnigma

Replies are listed 'Best First'.
Re^2: Challenge - Creative Way To Detect Alpha Characters
by Limbic~Region (Chancellor) on Sep 13, 2004 at 18:42 UTC
    TheEnigma,
    Do you want to do something only if there are no alpha characters

    Or the reciprocal - do something only if there are alpha chars. The trick is to figure it out creatively without using regular expressions. As you can see, assuming for a second plain jane ASCII, the only way lc $foo eq uc $foo can be true is if there are no alpha ([a-zA-Z]) characters in $foo.

    Cheers - L~R

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (1)
As of 2024-04-25 00:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found