uksza has asked for the wisdom of the Perl Monks concerning the following question:
Hello Wise Monks,
Is it good way?
Is any good (not switch/case) method to test it?
Thanx a lot
uksza
Is it good way?
Last try is good? Rather not (what about 55, 33 etc?)$test = 7; #(OK only when $test is 7,5 or 3) #OK, but... long print "OK\n" if ($test == 7 or $test == 5 or $test == 3); #NOT OK #print "OK\n" if ($test == (7 or 5 or 3)); #OK? print "OK\n" if ($test =~ /[753]/);
Is any good (not switch/case) method to test it?
Thanx a lot
uksza
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: IF and some conditions
by thcsoft (Monk) on Jun 02, 2005 at 11:41 UTC | |
by Joost (Canon) on Jun 02, 2005 at 11:51 UTC | |
Re: IF and some conditions
by Joost (Canon) on Jun 02, 2005 at 11:40 UTC | |
Re: IF and some conditions
by wfsp (Abbot) on Jun 02, 2005 at 11:51 UTC | |
by mugwumpjism (Hermit) on Jun 03, 2005 at 06:53 UTC | |
Re: IF and some conditions
by jhourcle (Prior) on Jun 02, 2005 at 11:54 UTC | |
Re: IF and some conditions
by tlm (Prior) on Jun 02, 2005 at 13:45 UTC | |
Re: IF and some conditions
by aukjan (Friar) on Jun 02, 2005 at 11:54 UTC | |
Re: IF and some conditions
by Ben Win Lue (Friar) on Jun 02, 2005 at 14:52 UTC | |
Re: IF and some conditions
by nedals (Deacon) on Jun 02, 2005 at 16:01 UTC | |
Perl6 Junctions
by mugwumpjism (Hermit) on Jun 03, 2005 at 06:48 UTC |
Back to
Seekers of Perl Wisdom