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
Back to
Seekers of Perl Wisdom