Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Re: Confused by a Conditional

by CheeseLord (Deacon)
on Jun 10, 2001 at 12:23 UTC ( [id://87280]=note: print w/replies, xml ) Need Help??


in reply to Re: Confused by a Conditional
in thread Confused by a Conditional

I admit, that's pretty cool. But I personally like this just a bit better (only because it takes up less space on the line):

#!/usr/bin/perl -w use strict; my $key = 'JUMP'; if ($key =~ /^(ID|TITLE|GENE|CYTOBAND|LOCUSLINK|CHROMOSOME|SCOUNT)$/) +{ print "I don't know why this is printing.\n"; }

I think there's someway that might be broken, though, if I remember my reading on regexes... but if you chomp everything right, I think it will accomplish the same thing (with the added benefit(?) of placing exactly what it matched in $1).

CheeseLord

Log In?
Username:
Password:

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

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

    No recent polls found