Andy, Try this:
if ( $letter =~ /^[A-L]$/ ) { do something; } You should be able to the same thing in ksh, just change the format a bit. -Michael McQuarrie --- "Nguyen, Andy" <[EMAIL PROTECTED]> wrote: > 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] > __________________________________________________ Do You Yahoo!? Buy the perfect holiday gifts at Yahoo! Shopping. http://shopping.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]