develooper Front page | perl.perl5.porters | Postings from November 2000

Re: Plan to try again with Carp

Thread Previous | Thread Next
From:
Wolfgang Laun
Date:
November 26, 2000 23:34
Subject:
Re: Plan to try again with Carp
Message ID:
3A220E6F.7E4E66A2@alcatel.at
Ben Tilly wrote:

> As I mentioned a long time ago, Carp's internal semantics
> make little sense.  There is also the possibility for
> endless loops if you have circular inheritance as this
> shows:
>
> package A;
> @ISA = ("A");
> use Carp;
> sub complain {
>     carp(shift);
> }
> package B;
> A::complain("Hello world\n");

And so does

  package A;
  @ISA = ("A");
  sub new { bless {}, shift }
  sub complain { shift->SUPER::complain; }
  package B;
  A->new->complain;

but this is not meant to imply that this should not be fixed in Carp.pm.

> So to summarize I would like to kill the undocumented
> $Carp::CarpLevel.

I think that $Carp::CarpLevel should be documented and not omitted.
Error reporting functions at some static calling level away from Carp
can make good use of it.

>    redo if $Internal{$pkg};
>    redo if $Ignore{$pkg};
 
How would these hashes be set up and/or maintained? (Comments in Carp
express strong sentiments so as not to cause delays during program load
& initialization time.)


>    redo if trusts($called, $caller, $cache);
>    redo if trusts($caller, $called, $cache);
>
> Where right now trusts would be basically "inherits from"
> though we could change that later.

I'm currently exploring and implementing the idea of adding Carp::layer,
whereby some package can add itself to the "trusted" group of another
package but I'll hold back if some rewrite is in the offing.

Regards,
-Wolfgang

Thread Previous | 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