Do not use on any
shared computer
September 6, 2008 02:07pm pdt
 
[x]
Attachment Details

I'm generating hundreds of megabytes in my error log file from one bad line of code.

I'm experiencing a new problem developing a site, a problem that I didn't have just a week ago.  Generally, I upload my perl programs to my server, and in a telnet window I "tail" the error log file.  I have warnings turned on.  So if I get warnings or terminal errors, I can see the problem right away in the telnet window, fix the code, upload and try again.  It's fast and it works.

But now, once in a while I'll hit an error, maybe a minor thing like an uninitialized variable warning, that will generate 2 megabytes of errors *per second* until I stop apache.  I don't think I'm in a program loop, and I've looked carefully, I thought.  But I got almost a gig of errors before I recognized what was happening the first time!

Here's an excerpt from the log file that is generated:

IPN_Return::__ANON__('Use of uninitialized value in join or string at /home/www/MyDom...') called at /usr/lib/perl5/5.8.8/Carp.pm line 272
Carp::cluck('Use of uninitialized value in join or string at /home/www/MyDom...') called at /home/www/MyDomain/root/cgi-bin/SA_PayPal_ipnReturn04.pl line 101
IPN_Return::__ANON__('Use of uninitialized value in join or string at /home/www/MyDom...') called at /usr/lib/perl5/5.8.8/Carp.pm line 272
Carp::cluck('Use of uninitialized value in join or string at /home/www/MyDom...') called at /home/www/MyDomain/root/cgi-bin/SA_PayPal_ipnReturn04.pl line 101
IPN_Return::__ANON__('Use of uninitialized value in join or string at /home/www/MyDom...') called at /usr/lib/perl5/5.8.8/Carp.pm line 272
Carp::cluck('Use of uninitialized value in join or string at /home/www/MyDom...') called at /home/www/MyDomain/root/cgi-bin/SA_PayPal_ipnReturn04.pl line 101
IPN_Return::__ANON__('Use of uninitialized value in join or string at /home/www/MyDom...') called at /usr/lib/perl5/5.8.8/Carp.pm line 272
Carp::cluck('Use of uninitialized value in join or string at /home/www/MyDom...') called at /home/www/MyDomain/root/cgi-bin/SA_PayPal_ipnReturn04.pl line 101
IPN_Return::__ANON__('Use of uninitialized value in join or string at /home/www/MyDom...') called at /usr/lib/perl5/5.8.8/Carp.pm line 272
Carp::cluck('Use of uninitialized value in join or string at /home/www/MyDom...') called at /home/www/MyDomain/root/cgi-bin/SA_PayPal_ipnReturn04.pl line 101
IPN_Return::__ANON__('Use of uninitialized value in join or string at /home/www/MyDom...') called at /usr/lib/perl5/5.8.8/Carp.pm line 272
Carp::cluck('Use of uninitialized value in join or string at /home/www/MyDom...') called at /home/www/MyDomain/root/cgi-bin/SA_PayPal_ipnReturn04.pl line 101
IPN_Return::__ANON__('Use of uninitialized value in join or string at /home/www/MyDom...') called at /usr/lib/perl5/5.8.8/Carp.pm line 272

... and on and on and on.  Eventually it mentions the original error again, and then more of this.

This is what's in a BEGIN{} block at the top of the program, SA_PayPal_ipnReturn04.pl:
use CGI::Carp;
use Carp 'cluck';
$SIG{__WARN__} = sub { cluck @_ };

I'm embarrassed to say I don't know why I use that exact syntax.  I found it in an article on debugging perl, and I place it at the top of every program, and it has always worked perfectly before.  Line 101 is the line that starts "$SIG{__WARN__}"

Of course, correct me if I'm wrong, but it seems that the problem of the error log file filling up is different from the problem of fixing this one particular uninitialized value.  I can't have perl filling all the hard disks with the error file and crashing the server every time it sees an error.

I don't know why this hasn't happened for the last 5 months, but it's happening now.

Can you give me ideas of where to go to look for the cause, or a better way to tell perl that I want excellent and convenient warnings and error reporting?  I can't use FatalsToBrowser for various reasons -- I want to tail the error log file.

Thanks so much for any insight.

Start your free trial to view this solution
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

Question Stats
Zone: Programming
Question Asked By: StevenMiles
Solution Provided By: clockwatcher
Participating Experts: 4
Solution Grade: A
Views: 0
Translate:
Loading Advertisement...
 
[+][-]Expert Comment by teraplane

Rank: Wizard

Expert Comment by teraplane:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by Perl_Diver

Rank: Master

Expert Comment by Perl_Diver:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by clockwatcher

Rank: Guru

Expert Comment by clockwatcher:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by StevenMiles
Author Comment by StevenMiles:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by clockwatcher

Rank: Guru

Expert Comment by clockwatcher:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by StevenMiles
Author Comment by StevenMiles:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Accepted Solution by clockwatcher

Rank: Guru

Accepted Solution by clockwatcher:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by Adam314

Rank: Genius

Expert Comment by Adam314:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
20080723-EE-VQP-34 / EE_QW_2_20070628