Help for this page

Select Code to Download


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