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 |