Jeff 'Japhy' wrote me this in a previous similar question:
<
You might be interested in the Quantum::Superpositions module, which
allows you to write:
if ($letter == any(A,B,C,D,...)) { ... }
>
Or maybe something like
if ($letter =~ m/^[A-Z]$/) {...}
HTH,
Etienne
"Nguyen, Andy" 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]
--
Etienne Marcotte
Specifications Management - Quality Control
Imperial Tobacco Ltd. - Montreal (Qc) Canada
514.932.6161 x.4001
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]