- or download this
use strict;
use warnings;
...
}
#no
- or download this
given (@arr) {
when (()) {say "The array is empty."}
when (34) {say "The array contains 34."}
default {say "Something else."}
}
- or download this
given (@arr) {
my @empty = ()
...
when (34) {say "The array contains 34."}
default {say "Something else."}
}
- or download this
my @arr1 = (2, 34);
say "34" if @arr1 ~~ 34;
#no output...??
- or download this
my @arr1 = ('hello', 'goodbye');
say "array size is 2" if @arr1 ~~ 2;
#no output