If you're on Linux, use the strace utilitiy to tell you what your script is doing while it hangs. Either run
strace -f perl mycode.pl input_file.txt > output.txtor start your script normally, wait till it hangs, find out the PID of the script process and execute
strace -f -p <PID>strace prints to STDERR, so you'll see the strace output normally in your terminal while STDOUT still gets written to the output file. It will tell you what the process is doing on a system call level. To find out where it hangs at the perl level you could execute it in the debugger and step through until it hangs.
perl -d mycode.pl input_file.txt > output.txtIn reply to Re: To Debug a Hanging Perl Script
by tirwhan
in thread To Debug a Hanging Perl Script
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |