in reply to Dear Venerable Monks
Lines 7 through 11: interesting use of a symbolic reference to create arrays named @1, @2, and so on. Stopped reading from that point on.
BTW: You didn't mention; does this code actually do what it is supposed to do? It would certainly benefit from a rewrite using modern Perl techniques (test open return values always, use lexical filehandles, use lexical variables, be strict/warnings compliant, don't use symbolic refs, and so on), but if it's already working.........
In Section
Seekers of Perl Wisdom