Could use a regex:
                if ( $x =~ /[XYZ]/ ) {
                   # if contains
                 }else
                   # if doesn't contain
                 }

        If there can be more than one character (like ' ABX') then you would need to 
add:

                $x =~ /^[XYZ]$/ 
          Also XYZ could be replaced as X-Z in the character class.

Wags ;)
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 04, 2002 11:34
To: [EMAIL PROTECTED]
Subject: Comparing to many possibles


Greetings;

Is there some perl shorthand that will make it easier to say

        if ( $x eq 'X' || $x eq 'Y' || $x eq 'Z' )

TIA,
Dennis

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to