Example 2-17. examples/scalars/junctions.p6
#!/usr/bin/perl6
say "Please select an option:";
say "1) one";
say "2) two";
say "3) three";
my $c = readline;
if ($c == 1 or $c == 2 or $c == 3) {
say "correct choice: $c";
} else {
say "Incorrect choice: $c";
}
if ($c == 1|2|3) {
say "correct choice: $c";
} else {
say "Incorrect choice: $c";
}
| Prev | Home (Copyright Gabor Szabo) Perl Training Israel | Next |
| String functions: substr | Up | Files in Perl6 |