™.. Carp::Clan - Online Linux Manual PageSection : 3
Updated : 2009-10-18
Source : perl v5.10.1
Note : User Contributed Perl Documentation

NAMECarp::Clan − Report errors from perspective of caller of a "clan" of modules

SYNOPSIS​ carp − warn of errors (from perspective of caller) ​ ​ cluck − warn of errors with stack backtrace ​ ​ croak − die of errors (from perspective of caller) ​ ​ confess − die of errors with stack backtrace ​ ​ use Carp::Clan qw(^MyClan::); ​ croak "We're outta here!"; ​ ​ use Carp::Clan; ​ confess "This is how we got here!";

DESCRIPTIONThis module is based on "\*(C`Carp.pm\*(C'\fR\*(L" from Perl 5.005_03. It has been modified to skip all package names matching the pattern given in the use statement inside the \*(C`qw()\*(C'\fR" term (or argument list). Suppose you have a family of modules or classes named Pack::A, ​Pack::B and so on, and each of them uses "\*(C`Carp::Clan qw(^Pack::);\*(C'\fR" (or at least the one in which the error or warning gets raised). Thus when for example your script tool.pl calls module Pack::A, and module Pack::A calls module Pack::B, an exception raised in module Pack::B will appear to have originated in tool.pl where ​Pack::A was called, and not in Pack::A where Pack::B was called, as the unmodified "\*(C`Carp.pm\*(C'\fR" would try to make you believe \f(CW\*(C`:\-)\*(C'\fR. This works similarly if Pack::B calls Pack::C where the exception is raised, etcetera. In other words, this blames all errors in the "\*(C`Pack::*\*(C'\fR" modules on the user of these modules, i.e., on you. \*(C`;\-)\*(C'\fR The skipping of a clan (or family) of packages according to a pattern describing its members is necessary in cases where these modules are not classes derived from each other (and thus when examining @ISA ​− as in the original "\*(C`Carp.pm\*(C'\fR" module \- doesn't help). The purpose and advantage of this is that a clan of modules can work together (and call each other) and throw exceptions at various depths down the calling hierarchy and still appear as a monolithic block (as though they were a single module) from the perspective of the caller. In case you just want to ward off all error messages from the module in which you "\*(C`use Carp::Clan\*(C'\fR\*(L", i.e., if you want to make all error messages or warnings to appear to originate from where your module was called (this is what you usually used to \*(C`use Carp;\*(C'\fR" for \f(CW\*(C`;\-)\*(C'\fR), instead of in your module itself (which is what you can do with a ​die or warn anyway), you do not need to provide a pattern, the module will automatically provide the correct one for you. I.e., just "\*(C`use Carp::Clan;\*(C'\fR\*(L" without any arguments and call \*(R"carp\*(L" or croak" as appropriate, and they will automatically defend your module against all blames! In other words, a pattern is only necessary if you want to make several modules (more than one) work together and appear as though they were only one.

Forcing a Stack TraceAs a debugging aid, you can force "\*(C`Carp::Clan\*(C'\fR\*(L" to treat a \*(R"croak\*(L" as a confess and a carp as a cluck". In other words, force a detailed stack trace to be given. This can be very helpful when trying to understand why, or from where, a warning or error is being generated. This feature is enabled either by importing the non-existent symbol ​'verbose', or by setting the global variable "$Carp::Clan::Verbose" to a true value. You would typically enable it by saying ​ use Carp::Clan qw(verbose); Note that you can both specify a family pattern and the string verbose inside the "\*(C`qw()\*(C'\fR\*(L" term (or argument list) of the \*(R"use\*(L" statement, but consider that a pattern of packages to skip is pointless when verbose" causes a full stack trace anyway.

BUGSThe "\*(C`Carp::Clan\*(C'\fR\*(L" routines don't handle exception objects currently. If called with a first argument that is a reference, they simply call \*(C`die()\*(C'\fR\*(L" or \*(R"\f(CW\*(C`warn()\*(C'\fR", as appropriate.
0
Johanes Gumabo
Data Size   :   13,596 byte
man-Carp::Clan.3pmBuild   :   2024-12-05, 20:55   :  
Visitor Screen   :   x
Visitor Counter ( page / site )   :   4 / 199,115
Visitor ID   :     :  
Visitor IP   :   13.59.250.115   :  
Visitor Provider   :   AMAZON-02   :  
Provider Position ( lat x lon )   :   39.962500 x -83.006100   :   x
Provider Accuracy Radius ( km )   :   1000   :  
Provider City   :   Columbus   :  
Provider Province   :   Ohio ,   :   ,
Provider Country   :   United States   :  
Provider Continent   :   North America   :  
Visitor Recorder   :   Version   :  
Visitor Recorder   :   Library   :  
Online Linux Manual Page   :   Version   :   Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page   :   Library   :   lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page   :   Library   :   lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base   :   Version   :   Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base   :   Library   :   lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36

Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.

ERROR : Need New Coding :         (parse_manual_page_|249|Carp::Clan.3pm|36/37|el══─{─══.|.el══─{─══. ds -- \|\(em\| )         (htmlprn|149|Carp::Clan.3pm|36/37|.el══─{─══. ds --  —  |.el══─{─══. ds -- \|\(em\| )         (parse_manual_page_|249|Carp::Clan.3pm|41|br══─}─══|'br══─}─══ )         (htmlprn|149|Carp::Clan.3pm|41|'br══─}─══ |'br══─}─══ )         (rof_nr_x|149|Carp::Clan.3pm|51/52|\nF|.ie \nF ══─{─══. de IX )         (rof_unit_scale_px|41|Carp::Clan.3pm|51/52|F|.ie \nF ══─{─══. de IX )         (rof_if|19|Carp::Clan.3pm|51/52|\nF|.ie \nF ══─{─══. de IX )         (htmlprn|149|Carp::Clan.3pm|51/52|.ie \nF ══─{─══. de IX|.ie \nF ══─{─══. de IX )         (rof_escape_sequence|91|Carp::Clan.3pm|53|\$1\t\\n%\t"\\$2" |. tm Index:\\$1\t\\n%\t"\\$2" )         (parse_manual_page_|249|Carp::Clan.3pm|57|══─}─══|.══─}─══ )         (htmlprn|149|Carp::Clan.3pm|57|.══─}─══ |.══─}─══ )         (rof_escape_sequence|91|Carp::Clan.3pm|153|\*(C`Carp.pm\*(C'\fR\*(L" from Perl 5.005_03. It has been |This module is based on "\f(CW\*(C`Carp.pm\*(C'\fR\*(L" from Perl 5.005_03. It has been )         (rof_escape_sequence|91|Carp::Clan.3pm|155|\*(C`qw()\*(C'\fR" term (or argument list). |the \*(R"use\*(L" statement inside the \*(R"\f(CW\*(C`qw()\*(C'\fR" term (or argument list). )         (rof_escape_sequence|91|Carp::Clan.3pm|158|\*(C`Carp::Clan qw(^Pack::);\*(C'\fR" |\&\*(L"Pack::B\*(R" and so on, and each of them uses "\f(CW\*(C`Carp::Clan qw(^Pack::);\*(C'\fR" )         (rof_escape_sequence|91|Carp::Clan.3pm|165|\*(C`Carp.pm\*(C'\fR" would try to make you believe \f(CW\*(C`:\-)\*(C'\fR. |as the unmodified "\f(CW\*(C`Carp.pm\*(C'\fR" would try to make you believe \f(CW\*(C`:\-)\*(C'\fR. )         (rof_escape_sequence|91|Carp::Clan.3pm|170|\*(C`Pack::*\*(C'\fR" modules |In other words, this blames all errors in the "\f(CW\*(C`Pack::*\*(C'\fR" modules )         (rof_escape_sequence|91|Carp::Clan.3pm|171|\*(C`;\-)\*(C'\fR |on the user of these modules, i.e., on you. \f(CW\*(C`;\-)\*(C'\fR )         (rof_escape_sequence|91|Carp::Clan.3pm|176|\*(C`Carp.pm\*(C'\fR" module \- doesn't help). |\&\- as in the original "\f(CW\*(C`Carp.pm\*(C'\fR" module \- doesn't help). )         (rof_escape_sequence|91|Carp::Clan.3pm|184|\*(C`use Carp::Clan\*(C'\fR\*(L", i.e., if you want to make all error |in which you "\f(CW\*(C`use Carp::Clan\*(C'\fR\*(L", i.e., if you want to make all error )         (rof_escape_sequence|91|Carp::Clan.3pm|186|\*(C`use Carp;\*(C'\fR" for \f(CW\*(C`;\-)\*(C'\fR), |was called (this is what you usually used to \*(R"\f(CW\*(C`use Carp;\*(C'\fR" for \f(CW\*(C`;\-)\*(C'\fR), )         (rof_escape_sequence|91|Carp::Clan.3pm|191|\*(C`use Carp::Clan;\*(C'\fR\*(L" without any arguments and call \*(R"carp\*(L" |I.e., just "\f(CW\*(C`use Carp::Clan;\*(C'\fR\*(L" without any arguments and call \*(R"carp\*(L" )         (rof_escape_sequence|91|Carp::Clan.3pm|200|\*(C`Carp::Clan\*(C'\fR\*(L" to treat a \*(R"croak\*(L" as |As a debugging aid, you can force "\f(CW\*(C`Carp::Clan\*(C'\fR\*(L" to treat a \*(R"croak\*(L" as )         (rof_escape_sequence|91|Carp::Clan.3pm|216|\*(C`qw()\*(C'\fR\*(L" term (or argument list) of the \*(R"use\*(L" statement, but |inside the "\f(CW\*(C`qw()\*(C'\fR\*(L" term (or argument list) of the \*(R"use\*(L" statement, but )         (rof_escape_sequence|91|Carp::Clan.3pm|221|\*(C`Carp::Clan\*(C'\fR\*(L" routines don't handle exception objects currently. |The "\f(CW\*(C`Carp::Clan\*(C'\fR\*(L" routines don't handle exception objects currently. )         (rof_escape_sequence|91|Carp::Clan.3pm|223|\*(C`die()\*(C'\fR\*(L" or \*(R"\f(CW\*(C`warn()\*(C'\fR", as appropriate. |call \*(R"\f(CW\*(C`die()\*(C'\fR\*(L" or \*(R"\f(CW\*(C`warn()\*(C'\fR", as appropriate. )