in reply to Extract ranges of lines from a file, saving each range to a separate file
your definition of $outputfile is wrong: it is a directory, impossible to write there, then you are never writing to $ofh anyway. In addition where are you creating a different outfile for each transaction?
Try to describe the correct procedure in english an then try to translate to Perl.
Doing everything during the while loop can be tricky for your Perl level (maybe), so try to semplify the process: put your distinct part of interest into a datastructure you feel comfortable with (array? an hash? arrayOFarras?).
Then cycle the datastructure and for each element decide a filename, open it, write to it what you need, close it and pass to next element.
It not so hard, I think, but post the code in case of problems.
L*
|
|---|