But this will compare line 1 against line 2 and then line 3 against line 4.while (my $timeOne = <INPUTFILE>) { my $timeTwo =<INPUTFILE>; print OUTPUTFILE "timeOne: $timeOne"; print OUTPUTFILE "timeTwo: $timeTwo"; my $result = $timeTwo - $timeOne; print OUTPUTFILE "result = $result \n"; }
In reply to compare subsequent lines by kevester
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |