in reply to Problem with subroutine

if ("`netstat -i | grep -i P01`" == "P01") { that is a string based comparisation and you're using ==, which is for numeric comparisations. If the rest of your code is executed, then HA_Check returns 1 (which is always the case when comparing numeric wise with strings).
I don't see any other subs defined besides Num_Files, File_Length and HA_Check. BTW no need to use exit at the end, perl will clean up automagically. That looks awfully look like Perl4 code! You're not using a VERY old book, are you? Or even worse, a VERY OLD Perl version??

Greetz
Beatnik
... Quidquid perl dictum sit, altum viditur.