This is almost more of a code review question. There are many choices you have made here that are not the best. Also, you have kind of just dumped your entire code and said "Help!", rather than ask a specific question. Basically, your problem is that you are printing while you are parsing, and you are using global variables where you should use lexical. You should (probably) parse first, using a separate subroutine, e.g.
sub parse_npc { ...
, saving the stats into a variable, e.g.
my $orc = parse_npc("orc.txt");
—
TLP 21 secs ago