Hi Dylan

"Dylan Boudreau" <[EMAIL PROTECTED]> wrote in message
004c01c2b8cd$0920dbb0$0400a8c0@dylan">news:004c01c2b8cd$0920dbb0$0400a8c0@dylan...
> I am trying to make a small menu for a script and the options are 1 or 2
> or 9.  I have it written like this
>
> until ($selection == '1|2|9'){
>      do some stuff
> }

I thought I should point out that you're doing a numeric comparison here,
for which purpose '1|2|9' will evaluate to 1. Doing things numerically
(instead of string-wise with a regex) you would have to write

    if ($selection == 1 or $selection == 2 or $selection == 9)

or

    if ( grep { $selection == $_ } (1, 2, 9) )

Cheers,

Rob




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

Reply via email to