[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] testing



I'd use a hash:

@tally{$a, $b, $c, $d} = ();
if (exists $tally{$value}) {
  ...
}

Nicholas.G.Thornton@directory.reed.edu (Nicholas G. Thornton) wrote:
>in the test part of an if statement is there a way to simplify...
>     if ($value == $a or $value == $b or  $value == $c or $value == $d or ...) 
>....into...
>     if ($value == ($a or $b or $c or $d or...))
>....or something similar? I can't seem to find it in the Camel book.
>
>le meas,
>--Nick
>
># ===== Want to unsubscribe from this list?
># ===== Send mail with body "unsubscribe" to macperl-request@macperl.org
>

  -------------------                            -------------------
  Ken Williams                             Last Bastion of Euclidity
  ken@forum.swarthmore.edu                            The Math Forum



# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org