Oh, goodie, you used an if. Care to quote the manual
where it says that in the context of an if, eq
propagates some magic to or to do what you suggest
it is doing?
Anyway, the following code uses if instead of
unless, and it does not print
"Damian is right"....
#!/usr/bin/perl -w
use strict;
my $key = 'LOCUSLINK';
if (($key) eq ('ID' or 'TITLE' or 'GENE' or 'CYTOBAND' or
'LOCUSLINK' or 'CHROMOSOME' or 'SCOUNT')) {
print "Damian is right\n";
}
Your code only happens to do the right think if $key
equals ID, or it's different from any of the clauses.
It'll fail to work when the key equals TITLE, GENE,
CYTOBAND, LOCUSLINK, CHROMOSOME,
or SCOUNT.
-- Abigail
| [reply] [d/l] |