in reply to Help with splitting one text file into other text files

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.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.