How do I debug my Perl programs?

Have you used -w?

Have you tried use strict?

Did you check the returns of each and every system call?

Did you read the perltrap manpage?

Have you tried the Perl debugger, described in the perldebug manpage?