in reply to Re^2: copying records from one file to another with filter.
in thread copying records from one file to another with filter.

Your code has at least one large problem:

use Switch;

This module is a bad idea and not recommended for use, even by its author anymore. Remove it and the switch construct. If you use Perl 5.10, use the new given keyword, otherwise use the approach you already got for the switch expression or use a chain of if ... elsif ... elsif statements.