gfxgfx
 
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
logo
 
gfx gfx
gfx
226 Posts in 93 Topics by 469 Members - Latest Member: suryamj September 08, 2010, 04:34:40 AM
*
gfx*HomeHelpSearchLoginRegistergfx
gfxgfx
0 Members and 1 Guest are viewing this topic.       « previous next »
Pages: [1] Go Down Print
Author Topic: Other perl programs: debug perl errors , server logs, and problem email output.  (Read 10589 times)
Boss
Administrator
Hero Member
*****
Offline Offline

Gender: Male
Posts: 133


'Wombat'


WWW
« on: September 11, 2005, 08:13:14 PM »

1)
Not always a good idea to advertize this as it can be abused by the inexperienced, but if one adds...

   use CGI::Carp qw/fatalsToBrowser/;

...just below the first (shebag) line of the primary called script one can often get slightly more meaningful errors displayed. JUST MAKE SURE Same is commented out (# char at start of line) OR BETTER delete the line once all is happening OK (else you can, if summink else goes a-up, give away all sorts of useful info to those who should not have such info!!!).

2)
Old fashioned Perl purists (before #...heads got to use the net) would not agree 'cause they think all error output is useful (OK if you are the programmer and on your own non shared box!), but...

IF you have a program that keeps filling up the logs with non-critical error/warning notices using up valuable disk space, then add....

   $^W=0;

...just below the top first line also only leave and don't remove as other debug line above. That should? stop all those mostly harmless Perl generated errors the programmer did not correct - also helps with the rare few hosts that demand the "-w" switch on the Perl shebang line too; but don't tell 'em.

3)
If have a perl program and you experience problems with email output (i.e. none getting through) AND your scripts are not using perl modules to create emails (quite common) then....

where/if your prob program uses code similar to....

   open (MAIL, "|/full/path/to/sendmail -t")

...then temp replace as...

   # ....open (MAIL, "|/full/path/to/sendmail -t")....
   ....open (MAIL,">>EMAILTEXT.TXT")....

and output should be deposited in a file named EMAILTEXT.TXT so you can check that there is output being generated.

Later remove the new line and the # character to free up the original line.

with some progs that use a perl module for email output, you can often find the point where the modulke::class is called and add before or after (temporarily)....

   open (MAIL,">>EMAILTEXT.TXT"); print MAIL "$createdemailstring\n"; close(MAIL);

Logged

'imself; Ron Woolley [ alias Wombat  ]
Melbourne Australia [PHParagon]
My programs never have bugs. However they may occasionally contain FREE 'random extended features'.
gfx
Pages: [1] Go Up Print 
gfx
Jump to:  
gfx gfx
Powered by MySQL Powered by PHP Valid XHTML 1.0! Valid CSS!