Without looking at your actual problem, and recognizing that you're doing this as an exercise, can I nonetheless recommend Perl::Tidy to reformat your code, leaving you free for other more useful things? Parsing Perl is notoriously difficult, most say impossible.
I should have described what the code needs to do better. It changes subroutine calls from having positional based parameters to using hash based parameters. Perl::Tidy won't take care of that.