Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Confused by a Conditional

by wog (Curate)
on Jun 09, 2001 at 21:16 UTC ( [id://87204]=note: print w/replies, xml ) Need Help??


in reply to Confused by a Conditional

The reason the conditional is coming out as true is that it is not parsed the way you think it is:

if ( ($key eq 'ID') or 'TITLE' or 'GENE' or 'CYTOBAND' or 'LOCUSLINK' or 'CHROMOSOME' or 'SCOUNT') # ... }

... is the same thing. The strings 'TITLE', etc. are considered true by perl.

(update: ... and everyone beats me and gives better answers. Sigh...)

Log In?
Username:
Password:

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

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

    No recent polls found