.\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "Carp::Always 3pm" .TH Carp::Always 3pm "2018-08-24" "perl v5.26.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Carp::Always \- Warns and dies noisily with stack backtraces .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Carp::Always; .Ve .PP Often used on the command line: .PP .Vb 1 \& perl \-MCarp::Always script.pl .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module is meant as a debugging aid. It can be used to make a script complain loudly with stack backtraces when \fIwarn()\fRing or \fIdie()\fRing. .PP Here are how stack backtraces produced by this module looks: .PP .Vb 5 \& # it works for explicit die\*(Aqs and warn\*(Aqs \& $ perl \-MCarp::Always \-e \*(Aqsub f { die "arghh" }; sub g { f }; g\*(Aq \& arghh at \-e line 1 \& main::f() called at \-e line 1 \& main::g() called at \-e line 1 \& \& # it works for interpreter\-thrown failures \& $ perl \-MCarp::Always \-w \-e \*(Aqsub f { $a = shift; @a = @$a };\*(Aq \e \& \-e \*(Aqsub g { f(undef) }; g\*(Aq \& Use of uninitialized value in array dereference at \-e line 1 \& main::f(\*(Aqundef\*(Aq) called at \-e line 2 \& main::g() called at \-e line 2 .Ve .PP In the implementation, the Carp module does the heavy work, through \f(CW\*(C`longmess()\*(C'\fR. The actual implementation sets the signal hooks \&\f(CW$SIG\fR{_\|_WARN_\|_} and \f(CW$SIG\fR{_\|_DIE_\|_} to emit the stack backtraces. .PP Also, all uses of \f(CW\*(C`carp\*(C'\fR and \f(CW\*(C`croak\*(C'\fR are made verbose, behaving like \f(CW\*(C`cluck\*(C'\fR and \f(CW\*(C`confess\*(C'\fR. .SH "METHODS" .IX Header "METHODS" Carp::Always implements the following methods. .SS "import" .IX Subsection "import" .Vb 1 \& Carp::Always\->import() .Ve .PP Enables Carp::Always. Also triggered by statements like .PP .Vb 2 \& use Carp::Always; \& use Carp::Always 0.14; .Ve .PP but not by .PP .Vb 1 \& use Carp::Always (); # does not invoke import() .Ve .SS "unimport" .IX Subsection "unimport" .Vb 1 \& Carp::Always\->unimport(); .Ve .PP Disables Carp::Always. Also triggered with .PP .Vb 1 \& no Carp::Always; .Ve .SH "ACKNOWLEDGMENTS" .IX Header "ACKNOWLEDGMENTS" This module was born as a reaction to a release of Acme::JavaTrace by Sébastien Aperghis-Tramoni. Sébastien also has a newer module called Devel::SimpleTrace with the same code and fewer flame comments on docs. The pruning of the uselessly long docs of this module was prodded by Michael Schwern. .PP Schwern and others told me \*(L"the module name stinked\*(R" \- it was called \f(CW\*(C`Carp::Indeed\*(C'\fR. After thinking long and getting nowhere, I went with nuffin's suggestion and now it is called \f(CW\*(C`Carp::Always\*(C'\fR. .SH "SEE ALSO" .IX Header "SEE ALSO" Carp .PP Acme::JavaTrace and Devel::SimpleTrace .PP Carp::Always::Color .PP Carp::Source::Always .PP Devel::Confess .PP Carp::Always::SyntaxHighlightSource and Carp::Always::DieOnly .SH "BUGS" .IX Header "BUGS" .IP "\(bu" 4 This module does not play well with other modules which fusses around with \f(CW\*(C`warn\*(C'\fR, \f(CW\*(C`die\*(C'\fR, \f(CW$SIG{_\|_WARN_\|_}\fR, \f(CW$SIG{_\|_DIE_\|_}\fR. .IP "\(bu" 4 Test scripts are good. I should write more of these. .PP Please report bugs via GitHub .PP Backlog in \s-1CPAN RT:\s0 .SH "AUTHOR" .IX Header "AUTHOR" Adriano Ferreira, .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" Copyright (C) 2005\-2013, 2018 by Adriano Ferreira .PP This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.