Help for this page

Select Code to Download


  1. or download this
    A slice of an empty list is still an empty list. Thus:
        @a = ()[1,0];           # @a has no elements
    ...
    More generally, a slice yields the empty list if it indexes only beyon
    +d the end of a list:
        @a = (1)[  1,2];        # @a has no elements
        @b = (1)[0,1,2];        # @b has three elements
    
  2. or download this
    use strict;
    use warnings;
    ...
              'world' => undef,
              'goodbye' => undef
            };
    
  3. or download this
    $VAR1 = {
              'mars' => 4,
              'hello' => 1,
            };
    
  4. or download this
    
    my @arr = (10, 20, 30, 40);
    ...
              40
            ];