Help for this page

Select Code to Download


  1. or download this
    my $first_item = $List[0];
    my $fifth_item = $List[4];
    print $fifth_item-$first_item, "\n";
    
  2. or download this
    for my $idx = (1 .. $#List) {
       my $val = $List[$idx] - $List[$idx-1];
       print "List[n] - List[n-1] = ", $val, " for n=", $idx, "\n";
    }