Help for this page

Select Code to Download


  1. or download this
    my @array;
    
    ...
    delete $array[2];
    print "Delete element 2: last at $#array\n";
    
  2. or download this
       Set element 4: last at 4
    Delete element 4: last at 2
    Delete element 2: last at -1
    
  3. or download this
    use strict;
    use warnings;
    ...
    my $listref = ['a','b','c','d','e'];
    @$listref = @{$listref}[0, 2, 4];
    print "@$listref\n";