Hi, I am new to perl. I am trying to write a simple script that will pass through an array subtracting the value of the an element from that of the next and so on. Reporting each answer on a new line. One of my many problems is that I am not sure how to refer to the n+1 element in an array: Here what I have so far:
open(FILE, "filename.txt") or die("Unable to open file");
@List = <FILE>;
foreach $line (@List)
print ($line+1) - $line);
Any help would be much appreciated!