How about:
my %handles; open $handles{ $_ }, '>', "sec.$_" for 1996 .. 2010; while( <> ) { m[^(\d{4})] and print { $handles{ $1 } } $_; } close for @handles;
That assumes that the date is the first four characters of the record; and all the dates are in the range specified.
In reply to Re: Help with splitting one text file into other text files
by BrowserUk
in thread Help with splitting one text file into other text files
by eversuhoshin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |