Help for this page

Select Code to Download


  1. or download this
    my @array = qw(one two three);
    
    my $last_index = $#array;         # Index of last element (2)
    my $last_element = $array[ -1 ];  # Value of last element (three)
    
  2. or download this
    my $count = @array;               # Number of elements (3)
    $#array = 99;                     # Extend/Truncate array