Perl's core modules include 'Memoize', which attempts to make functions faster by "trading space for time."
But I'd have to do trial-and-error to see what worked. (I'm wondering if a regExp would be faster than split)
my $X = $1
Then you wouldn't even need to call chomp. (And in general, I'm wondering if it would speed things up to combine the other instructions.)
chomp( my($line)=$_ ) ;
UPDATE: It occurred to me that the code re-declares every variable again on every pass through the loop. It seems like it might help to try
my ($X, $Y, $A, $B, $C, $D);