in reply to subtractionn in an array
my $first_item = $List[0]; my $fifth_item = $List[4]; print $fifth_item-$first_item, "\n";
Update:
for my $idx = (1 .. $#List) { my $val = $List[$idx] - $List[$idx-1]; print "List[n] - List[n-1] = ", $val, " for n=", $idx, "\n"; }
...roboticus
When your only tool is a hammer, all problems look like your thumb.
|
|---|