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

(ar0n) Re: Confused by a Conditional

by ar0n (Priest)
on Jun 09, 2001 at 21:15 UTC ( [id://87202]=note: print w/replies, xml ) Need Help??


in reply to Confused by a Conditional

Because strings are true. You're checking to see if $key is 'ID', or if 'TITLE' is true, or if 'GENE' is true, etc. string constants are always true.

I think you're trying to see if $key is one of those strings. In that case, you could use:
if ( grep { $key eq $_ } qw(ID TITLE GENE CYTOBAND LOCUSLINK CHROMOSOM +E SCOUNT) ) { # do your stuff }
... which will check to see if $key matches at least one of those.

ar0n ]

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (6)
As of 2024-04-18 19:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found