in reply to Re^4: copying records from one file to another with filter.
in thread copying records from one file to another with filter.
If the data you show is the actual format, you're going to need to make sure all your dates are in the correct format. The dates in the data have leading zeros in single digit months and days but your search terms do not. That's likely to cause an issue. Build your search string with a sprintf function rather than just concatenating numbers.
If you need to do more complex date calculations, you are better of using one of the modules designed to work with date data. Date::Calc and Date::Manip are two well known modules that can help with that.
If you are getting uninitialized value warnings, you need to check why. Look at the warning. It tells you where the problem occurred. My suspicion is the there is a blank line on line 122 in the input file, which means there wasn't any data to split, so the variables being printed were uninitialized. If that is a problem, just check for blank lines before splitting or empty variables before printing.
|
|---|