Commit | Line | Data |
---|---|---|
8d063cd8 LW |
1 | #!./perl |
2 | ||
8d063cd8 LW |
3 | sub foo { |
4 | if ($_[0] == 1) { | |
5 | 1; | |
6 | } | |
7 | elsif ($_[0] == 2) { | |
8 | 2; | |
9 | } | |
10 | elsif ($_[0] == 3) { | |
11 | 3; | |
12 | } | |
13 | else { | |
14 | 4; | |
15 | } | |
16 | } | |
17 | ||
18 | print "1..4\n"; | |
19 | ||
a0d0e21e LW |
20 | if (($x = &foo(1)) == 1) {print "ok 1\n";} else {print "not ok 1 '$x'\n";} |
21 | if (($x = &foo(2)) == 2) {print "ok 2\n";} else {print "not ok 2 '$x'\n";} | |
22 | if (($x = &foo(3)) == 3) {print "ok 3\n";} else {print "not ok 3 '$x'\n";} | |
23 | if (($x = &foo(4)) == 4) {print "ok 4\n";} else {print "not ok 4 '$x'\n";} |