You do not really need to split the lines to find the time. Extract it with a regex and then print the line unless the time is within 6 hours either side of noon:
use strict; use warnings; abs( 1200 - join "", /(\d\d):(\d\d)/ ) < 600 or print while(<DATA>); __DATA__ **FAILED PROD** - BUGS - 08/26/13 @05:12 - BUGS~23AUG13~23AUG13~23AUG1 +3~26AUG13~ **FAILED PROD** - BUGS - 08/26/13 @11:12 - BUGS~23AUG13~23AUG13~23AUG1 +3~26AUG13~1109 **FAILED PROD** - cockroach - 08/29/13 @11:52 -cockroach~29AUG13~29AUG +13~29AUG13~29AUG13~1152 **FAILED PROD** - cockroach - 08/29/13 @18:00 -cockroach~29AUG13~29AUG +13~29AUG13~29AUG13~1152
In reply to Re: How to read each line of file into an array and split contnts of each line into array cells
by hdb
in thread How to read each line of file into an array and split contnts of each line into array cells
by crazy-duck
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |