Probably many ways to do this but one would be 

if (($letter ge "A") && ($letter le "L")) {
        do something
}

____________________
Chris Spurgeon
Senior Design Technologist
[EMAIL PROTECTED]

ELECTRONIC INK
One South Broad Street
19th Floor
Philadelphia, PA 19107
www.electronicink.com

t 215.922.3800 x(233)
f 215.922.3880


-----Original Message-----
From: Nguyen, Andy [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 05, 2001 2:17 PM
To: '[EMAIL PROTECTED]'
Subject: Help with Perl


Hi List,

I am new to perl and looking for a shortcut way of doing this.

# $letter could be any letter from A to L.
if ( $letter eq "A" || $letter "B" || $letter "C" || $letter eq "D"
............. || $letter eq "L" )
{
  do something
}

I really don't want to repeat $letter for every letter (B-L).

In ksh Shell, I can do:

if [[ $letter = @(A|B|B|C|D|.......|L) ]]
then
   do something
fi

 Any help will be appreciated.

Thanks
Andy

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
This e-mail is intended solely for the above-mentioned recipient and it may
contain confidential or privileged information.  If you have received it in
error, please notify us immediately and delete the e-mail.  You must not
copy, distribute, disclose or take any action in reliance on it.  In
addition, the contents of an attachment to this e-mail may contain software
viruses which could damage your own computer system.  While Electronic Ink,
Inc. has taken every reasonable precaution to minimize this risk, we cannot
accept liability for any damage which you sustain as a result of software
viruses.  You should perform your own virus checks before opening the
attachment.

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

Reply via email to