open (FILE, "edidocs.csv") or die "Can't open file $!\n"; my( $curr_time, $prev_time ); # Sorry about the $ in the original while( ) { $prev_time = $curr_time; $curr_time = ( split /,/ )[1]; }