switchやcaseらしきもの
使う場面があるかなぁ。まぁ一応知識として。
1 #!/usr/bin/perl 2 use strict; 3 4 for (qw/first fourth fifth third/) { 5 6 /first/ && do {print "1st\n";}; 7 8 /second/ && do {print "2nd\n";}; 9 10 (/third/ || /fifth/) && do {print "3rd or 5th\n";}; 11 12 } 13 $ ./hoge.pl 1st 3rd or 5th 3rd or 5th