in reply to Re: Can someone tell me why this hangs??
in thread Can someone tell me why this hangs??

I like to declare a variable at the top of the script, like $DEBUG or something catchy, then use if statements to print variables throughout the script. This way you can easily turn debugging off or on.

Example:

my $DEBUG = 1; #Set to 1 (print debugging info) or 0 (no debugging) print "Script executing...\n" if $DEBUG; do_stuff(); sub do_stuff{ print "sub->do_stuff()\n" if $DEBUG; #do things here... }