Help for this page

Select Code to Download


  1. or download this
    my @array = (2, 4, 6, 8);
    
    ...
    # @array is (6, 8)
    # $array[0] is 6
    # $array[1] is 8
    
  2. or download this
    my ($first) = (2, 4, 6, 8);
    my ($first, $second) = (2, 4, 6, 8);
    ...
    # undef can be used to "skip" elements you don't want to assign
    # to anything:
    my (undef, undef, $third) = (2, 4, 6, 8);