in reply to while nested in foreach
From your description it seems as if you need an if between the next and the (($day...
Something like
Update: D'oh Abigail-II was much faster with his reply. -----next if (($day_counter == 0)&&(substr($_,9,2)<17)); next if (($day_counter == 1)&&(substr($_,9,2)>16));
Of all the things I've lost in my life, its my mind I miss the most.
In Section
Seekers of Perl Wisdom