- or download this
given($foo) {
when (/x/) { say '$foo contains an x'; continue }
when (/y/) { say '$foo contains a y' }
default { say '$foo contains neither an x nor a y' }
}
- or download this
#!/usr/local/bin/perl
use feature qw{ switch };
...
match 3;
match 4;
match 5;
- or download this
1:
2:
3:
4:
5:
- or download this
#include <stdio.h>
#include <stdlib.h>
...
exit( 0 );
}
- or download this
1: 4
2:
3:
4:
5:
- or download this
#!/usr/local/bin/perl
use feature qw{ switch };
...
match 'Just another Perl hacker';
match 'Just another Perl slacker';
- or download this
Just another Perl hacker: Me too!
Just another Perl slacker:
- or download this
$foo contains an x
$foo contains neither an x nor a y