develooper Front page | perl.perl5.porters | Postings from June 2009

Re: [perl #42329] Carp::croak() replace user error message by own

Thread Next
From:
Alex Efros
Date:
June 29, 2009 03:13
Subject:
Re: [perl #42329] Carp::croak() replace user error message by own
Message ID:
20090629092444.GC2585@home.power
Hi!

On Sun, Jun 28, 2009 at 07:02:40AM -0700, Bram via RT wrote:
> > Now shows:
> > 
> > Failed to load Carp::Heavy.  Consider adding use Carp::Heavy in your code.
> > Carp-Error: Can't locate Carp/Heavy.pm:   Too many open files at lib/Carp.pm line 44.
> > Args: abc
> 
> Any feedback on this? (patch is in RT)

I think that's wrong way to solve this issue, but it's better that nothing.


The problem is, right now all my scripts which doing heavy I/O contain line:

 require Carp::Heavy; # http://rt.perl.org/rt3/Public/Bug/Display.html?id=42329

and while I love to see this line removed from my scripts, with this patch
it still not possible.


Only I can do is try to explain again: error-reporting code like Carp MUST NOT
request additional resources - because if some error happens it's very
likely 'not enough resources' error and trying to get more resources just
to show error message just feels wrong.

I think correct solution will be to load Carp::Heavy together with Carp.
I see no reason to delay loading Carp::Heavy - it's very small and
shouldn't affect performance. Moreover, if you wanna speedup Carp loading,
then there a lot of other techniques - like moving POD to the bottom of
file under __END__. Also consider just moving Carp::Heavy content to Carp,
this shouldn't increase Carp module load time by any noticeable value and
also allow to do some code cleanup.

-- 
			WBR, Alex.

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About