in reply to Re: Date sorting
in thread Date sorting

The problem was solved by closing the file GPsmk4 (see below). Leaving this filehandle open caused all my problems! Thanks for your suggestions ! Regards, Stacy.
open(CLOCK,"$gps2_log") or die "$gps2_log not available: $!\n"; open(GPSmk4,">>/tmp/gpsmk4.dat"); while($line = <CLOCK>) { next if $line =~ /last/; ($month,$day,$time) = ( split(/\s+/,$line) )[0..2]; ($hour,$min,$sec) = split(':',$time); $month = sprintf "%02d", $months{$month}; $day = sprintf "%02d", $day; $data3 = ( split(/\s+/,$line) )[6]; last if(compare_dates([$month,$day,$hour,$min,$sec],$edate_cursor)>0); if (compare_dates([$month,$day,$hour,$min,$sec],$sdate_cursor)>0); { if( $data3 > $plotymax ) { $plotymax = $data3; } if( $data3 < $plotymin ) { $plotymin = $data3; } print GPSmk4 "$month-$day $time $data3\n"; } # update the date cursor $date_cursor = [$month,$day,$hour,$min,$sec]; +close(GPSmk4); } #end of while