It looks like you're using a global to pass arguments into handlefix. But the global you decided to use is @_, and Perl's subroutine calling mechanism also uses @_ to pass arguments, so those "global" values are not seen inside the sub. Why not use a normal method of passing arguments to a sub?
my $infile = !@ARGV?<>:shift @ARGV;
my $outfile = !@ARGV?<>:shift @ARGV;
handlefix($infile, $outfile);
You don't even have to change handlefix.
Might I also suggest to rewrite conditionals to avoid having a negative condition? For example, $infile = @ARGV ? shift @ARGV : <>