--- Doug Johnson <[EMAIL PROTECTED]> wrote:
> Is there a better way to write:
> my $x = "return";
> if (($x = "a") 
> || ($x = "test" ) 
> || ($x = "return" )
> || ($x = "x-retun"))
>    {
>    print("bunch of foo....);
>    }

Several =o) [and my apologies for the reformat, but I needed to fit it
into my mailer window, lol... ;o]

Others have mentioned that you're assigning with = instead of ==, and
that you need eq instead of == when using strings, etc.... So I'll just
make a suggestion. Try a pattern match.

if ($x =! /^(a|test|return|x-retun)$/) { # etc. >:o]
 
Paul

PS -- the hash solution already mentioned is more efficient, but this
might be more readable.

__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/

Reply via email to