| Line | |
|---|
| 1 | BEGIN {
|
|---|
| 2 | if ($ENV{PERL_CORE}) {
|
|---|
| 3 | chdir('t') if -d 't';
|
|---|
| 4 | @INC = qw(../lib);
|
|---|
| 5 | }
|
|---|
| 6 | }
|
|---|
| 7 |
|
|---|
| 8 | use Switch;
|
|---|
| 9 |
|
|---|
| 10 | print "1..4\n";
|
|---|
| 11 |
|
|---|
| 12 | my $count = 1;
|
|---|
| 13 | for my $count (1..3, 'four')
|
|---|
| 14 | {
|
|---|
| 15 | switch ([$count])
|
|---|
| 16 | {
|
|---|
| 17 |
|
|---|
| 18 | =pod
|
|---|
| 19 |
|
|---|
| 20 | =head1 Test
|
|---|
| 21 |
|
|---|
| 22 | We also test if Switch is POD-friendly here
|
|---|
| 23 |
|
|---|
| 24 | =cut
|
|---|
| 25 |
|
|---|
| 26 | case qr/\d/ {
|
|---|
| 27 | switch ($count) {
|
|---|
| 28 | case 1 { print "ok 1\n" }
|
|---|
| 29 | case [2,3] { print "ok $count\n" }
|
|---|
| 30 | }
|
|---|
| 31 | }
|
|---|
| 32 | case 'four' { print "ok 4\n" }
|
|---|
| 33 | }
|
|---|
| 34 | }
|
|---|
| 35 |
|
|---|
| 36 | __END__
|
|---|
| 37 |
|
|---|
| 38 | =head1 Another test
|
|---|
| 39 |
|
|---|
| 40 | Still friendly???
|
|---|
| 41 |
|
|---|
| 42 | =cut
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.