I have a while loop for a data file that is nested in a foreach loop (to look at 2 data files). My next statements inside the while loop are not working at all. They seem to be doing the next on the foreach instead of the while. Is there a way around this?
I'm looking at raw test data and trying to skip data before 5pm the previous day and after 5pm of the current day. The substr is where the hour is located on the data line.
$day_counter = 0;
foreach $dat_file ( @dat_file ) {
open RAW, "<$dat_file";
while ( <RAW> ) {
next (($day_counter == 0)&&(substr($_,9,2)<17));
next (($day_counter == 1)&&(substr($_,9,2)>16));
($sum,$error) = 0;
@numbers = split( '\t', $_ );