New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No subject provided #1008
Comments
From wolfgang.laun@chello.at=head1 Perl bug report: Library Module Carp This concerns Carp::Heavy.pm in all 5.005 versions, including the =head2 Bug: carp and croak may fail to show "caller" Carp's carp and croak used in some module M should report errors from Consider this set of modules (on file Animal.pm): #======================================================== sub new { sub dump { sub teeth { #======================================================== sub new { #======================================================== sub new { sub name { sub gnaw { Now, let's run this program: use Animal; carp reports lines within Animal.pm! Both the call of Rodent::name The algorithm in shortmess_heavy is faulty as it fails to look beyond While fixing this, the $CarpLevel feature required some consideration. =head2 Is $CarpLevel really useful? While not in the official documentation, the comments in Heavy.pm would I doubt that this can be achieved in this simple manner. First, any To make this feature robust, we'd need a call telling Carp to treat a Carp::Adopt( M, W ); If some M subroutine carps, and the chain of callers passes into This probably should also influence the longmess_heavy algorithm. (As this goes way beyond a simple bugfix, I've refrained from touching =head2 Author: Wolfgang Laun <Wolfgang.Laun@chello.at> =cut package Carp; =head1 NAME Carp::Heavy - Carp guts =head1 SYNOPIS (internal use only) =head1 DESCRIPTION No user-serviceable parts inside. =cut # This package is heavily used. Be small. Be fast. Be good. # Comments added by Andy Wardley <abw@kfs.org> 09-Apr-98, based on an # longmess() crawls all the way up the stack reporting on all the function sub longmess_heavy { # ancestors() returns the complete set of ancestors of a module sub ancestors($$){ # shortmess() is called by carp() and croak() to skip all the way up to sub shortmess_heavy { # Short-circuit &longmess if called via multiple packages my @Clans = ( $prevpack ); # merge all the caller's @ISA packages and ancestors into %isa. # now we crawl up the calling stack and look at all the packages in # Chances are, the caller's caller (or its caller...) is already # no: collect this module's ancestors. # Hey! We've found a package that isn't one of our caller's # uh-oh! It looks like we crawled all the way up the stack and 1; |
Migrated from rt.perl.org#1958 (status was 'resolved')
Searchable as RT1958$
The text was updated successfully, but these errors were encountered: