config root man

Current Path : /usr/opt/perl530/man/man3/

FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64
Upload File :
Current File : //usr/opt/perl530/man/man3/Carp.3

.\" Automatically generated by Pod::Man 4.11 (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
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
.    if \nF \{\
.        de IX
.        tm Index:\\$1\t\\n%\t"\\$2"
..
.        if !\nF==2 \{\
.            nr % 0
.            nr F 2
.        \}
.    \}
.\}
.rr rF
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear.  Run.  Save yourself.  No user-serviceable parts.
.    \" fudge factors for nroff and troff
.if n \{\
.    ds #H 0
.    ds #V .8m
.    ds #F .3m
.    ds #[ \f1
.    ds #] \fP
.\}
.if t \{\
.    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
.    ds #V .6m
.    ds #F 0
.    ds #[ \&
.    ds #] \&
.\}
.    \" simple accents for nroff and troff
.if n \{\
.    ds ' \&
.    ds ` \&
.    ds ^ \&
.    ds , \&
.    ds ~ ~
.    ds /
.\}
.if t \{\
.    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
.    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
.    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
.    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
.    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
.    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
.    \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
.    \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
.    \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
.    ds : e
.    ds 8 ss
.    ds o a
.    ds d- d\h'-1'\(ga
.    ds D- D\h'-1'\(hy
.    ds th \o'bp'
.    ds Th \o'LP'
.    ds ae ae
.    ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "Carp 3"
.TH Carp 3 "2019-10-24" "perl v5.30.2" "Perl Programmers Reference Guide"
.\" 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 \- alternative warn and die for modules
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
.Vb 1
\&    use Carp;
\&
\&    # warn user (from perspective of caller)
\&    carp "string trimmed to 80 chars";
\&
\&    # die of errors (from perspective of caller)
\&    croak "We\*(Aqre outta here!";
\&
\&    # die of errors with stack backtrace
\&    confess "not implemented";
\&
\&    # cluck, longmess and shortmess not exported by default
\&    use Carp qw(cluck longmess shortmess);
\&    cluck "This is how we got here!"; # warn with stack backtrace
\&    $long_message   = longmess( "message from cluck() or confess()" );
\&    $short_message  = shortmess( "message from carp() or croak()" );
.Ve
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
The Carp routines are useful in your own modules because
they act like \f(CW\*(C`die()\*(C'\fR or \f(CW\*(C`warn()\*(C'\fR, but with a message which is more
likely to be useful to a user of your module.  In the case of
\&\f(CW\*(C`cluck()\*(C'\fR and \f(CW\*(C`confess()\*(C'\fR, that context is a summary of every
call in the call-stack; \f(CW\*(C`longmess()\*(C'\fR returns the contents of the error
message.
.PP
For a shorter message you can use \f(CW\*(C`carp()\*(C'\fR or \f(CW\*(C`croak()\*(C'\fR which report the
error as being from where your module was called.  \f(CW\*(C`shortmess()\*(C'\fR returns the
contents of this error message.  There is no guarantee that that is where the
error was, but it is a good educated guess.
.PP
\&\f(CW\*(C`Carp\*(C'\fR takes care not to clobber the status variables \f(CW$!\fR and \f(CW$^E\fR
in the course of assembling its error messages.  This means that a
\&\f(CW$SIG{_\|_DIE_\|_}\fR or \f(CW$SIG{_\|_WARN_\|_}\fR handler can capture the error
information held in those variables, if it is required to augment the
error message, and if the code calling \f(CW\*(C`Carp\*(C'\fR left useful values there.
Of course, \f(CW\*(C`Carp\*(C'\fR can't guarantee the latter.
.PP
You can also alter the way the output and logic of \f(CW\*(C`Carp\*(C'\fR works, by
changing some global variables in the \f(CW\*(C`Carp\*(C'\fR namespace. See the
section on \f(CW\*(C`GLOBAL VARIABLES\*(C'\fR below.
.PP
Here is a more complete description of how \f(CW\*(C`carp\*(C'\fR and \f(CW\*(C`croak\*(C'\fR work.
What they do is search the call-stack for a function call stack where
they have not been told that there shouldn't be an error.  If every
call is marked safe, they give up and give a full stack backtrace
instead.  In other words they presume that the first likely looking
potential suspect is guilty.  Their rules for telling whether
a call shouldn't generate errors work as follows:
.IP "1." 4
Any call from a package to itself is safe.
.IP "2." 4
Packages claim that there won't be errors on calls to or from
packages explicitly marked as safe by inclusion in \f(CW@CARP_NOT\fR, or
(if that array is empty) \f(CW@ISA\fR.  The ability to override what
\&\f(CW@ISA\fR says is new in 5.8.
.IP "3." 4
The trust in item 2 is transitive.  If A trusts B, and B
trusts C, then A trusts C.  So if you do not override \f(CW@ISA\fR
with \f(CW@CARP_NOT\fR, then this trust relationship is identical to,
\&\*(L"inherits from\*(R".
.IP "4." 4
Any call from an internal Perl module is safe.  (Nothing keeps
user modules from marking themselves as internal to Perl, but
this practice is discouraged.)
.IP "5." 4
Any call to Perl's warning system (eg Carp itself) is safe.
(This rule is what keeps it from reporting the error at the
point where you call \f(CW\*(C`carp\*(C'\fR or \f(CW\*(C`croak\*(C'\fR.)
.IP "6." 4
\&\f(CW$Carp::CarpLevel\fR can be set to skip a fixed number of additional
call levels.  Using this is not recommended because it is very
difficult to get it to behave correctly.
.SS "Forcing a Stack Trace"
.IX Subsection "Forcing a Stack Trace"
As a debugging aid, you can force Carp to treat a croak as a confess
and a carp as a cluck across \fIall\fR modules. 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.
.PP
This feature is enabled by 'importing' the non-existent symbol
\&'verbose'. You would typically enable it by saying
.PP
.Vb 1
\&    perl \-MCarp=verbose script.pl
.Ve
.PP
or by including the string \f(CW\*(C`\-MCarp=verbose\*(C'\fR in the \s-1PERL5OPT\s0
environment variable.
.PP
Alternately, you can set the global variable \f(CW$Carp::Verbose\fR to true.
See the \f(CW\*(C`GLOBAL VARIABLES\*(C'\fR section below.
.SS "Stack Trace formatting"
.IX Subsection "Stack Trace formatting"
At each stack level, the subroutine's name is displayed along with
its parameters.  For simple scalars, this is sufficient.  For complex
data types, such as objects and other references, this can simply
display \f(CW\*(AqHASH(0x1ab36d8)\*(Aq\fR.
.PP
Carp gives two ways to control this.
.IP "1." 4
For objects, a method, \f(CW\*(C`CARP_TRACE\*(C'\fR, will be called, if it exists.  If
this method doesn't exist, or it recurses into \f(CW\*(C`Carp\*(C'\fR, or it otherwise
throws an exception, this is skipped, and Carp moves on to the next option,
otherwise checking stops and the string returned is used.  It is recommended
that the object's type is part of the string to make debugging easier.
.IP "2." 4
For any type of reference, \f(CW$Carp::RefArgFormatter\fR is checked (see below).
This variable is expected to be a code reference, and the current parameter
is passed in.  If this function doesn't exist (the variable is undef), or
it recurses into \f(CW\*(C`Carp\*(C'\fR, or it otherwise throws an exception, this is
skipped, and Carp moves on to the next option, otherwise checking stops
and the string returned is used.
.IP "3." 4
Otherwise, if neither \f(CW\*(C`CARP_TRACE\*(C'\fR nor \f(CW$Carp::RefArgFormatter\fR is
available, stringify the value ignoring any overloading.
.SH "GLOBAL VARIABLES"
.IX Header "GLOBAL VARIABLES"
.ie n .SS "$Carp::MaxEvalLen"
.el .SS "\f(CW$Carp::MaxEvalLen\fP"
.IX Subsection "$Carp::MaxEvalLen"
This variable determines how many characters of a string-eval are to
be shown in the output. Use a value of \f(CW0\fR to show all text.
.PP
Defaults to \f(CW0\fR.
.ie n .SS "$Carp::MaxArgLen"
.el .SS "\f(CW$Carp::MaxArgLen\fP"
.IX Subsection "$Carp::MaxArgLen"
This variable determines how many characters of each argument to a
function to print. Use a value of \f(CW0\fR to show the full length of the
argument.
.PP
Defaults to \f(CW64\fR.
.ie n .SS "$Carp::MaxArgNums"
.el .SS "\f(CW$Carp::MaxArgNums\fP"
.IX Subsection "$Carp::MaxArgNums"
This variable determines how many arguments to each function to show.
Use a false value to show all arguments to a function call.  To suppress all
arguments, use \f(CW\*(C`\-1\*(C'\fR or \f(CW\*(Aq0 but true\*(Aq\fR.
.PP
Defaults to \f(CW8\fR.
.ie n .SS "$Carp::Verbose"
.el .SS "\f(CW$Carp::Verbose\fP"
.IX Subsection "$Carp::Verbose"
This variable makes \f(CW\*(C`carp()\*(C'\fR and \f(CW\*(C`croak()\*(C'\fR generate stack backtraces
just like \f(CW\*(C`cluck()\*(C'\fR and \f(CW\*(C`confess()\*(C'\fR.  This is how \f(CW\*(C`use Carp \*(Aqverbose\*(Aq\*(C'\fR
is implemented internally.
.PP
Defaults to \f(CW0\fR.
.ie n .SS "$Carp::RefArgFormatter"
.el .SS "\f(CW$Carp::RefArgFormatter\fP"
.IX Subsection "$Carp::RefArgFormatter"
This variable sets a general argument formatter to display references.
Plain scalars and objects that implement \f(CW\*(C`CARP_TRACE\*(C'\fR will not go through
this formatter.  Calling \f(CW\*(C`Carp\*(C'\fR from within this function is not supported.
.PP
local \f(CW$Carp::RefArgFormatter\fR = sub {
    require Data::Dumper;
    Data::Dumper::Dump($_[0]); # not necessarily safe
};
.ie n .SS "@CARP_NOT"
.el .SS "\f(CW@CARP_NOT\fP"
.IX Subsection "@CARP_NOT"
This variable, \fIin your package\fR, says which packages are \fInot\fR to be
considered as the location of an error. The \f(CW\*(C`carp()\*(C'\fR and \f(CW\*(C`cluck()\*(C'\fR
functions will skip over callers when reporting where an error occurred.
.PP
\&\s-1NB:\s0 This variable must be in the package's symbol table, thus:
.PP
.Vb 4
\&    # These work
\&    our @CARP_NOT; # file scope
\&    use vars qw(@CARP_NOT); # package scope
\&    @My::Package::CARP_NOT = ... ; # explicit package variable
\&
\&    # These don\*(Aqt work
\&    sub xyz { ... @CARP_NOT = ... } # w/o declarations above
\&    my @CARP_NOT; # even at top\-level
.Ve
.PP
Example of use:
.PP
.Vb 9
\&    package My::Carping::Package;
\&    use Carp;
\&    our @CARP_NOT;
\&    sub bar     { .... or _error(\*(AqWrong input\*(Aq) }
\&    sub _error  {
\&        # temporary control of where\*(Aqness, _\|_PACKAGE_\|_ is implicit
\&        local @CARP_NOT = qw(My::Friendly::Caller);
\&        carp(@_)
\&    }
.Ve
.PP
This would make \f(CW\*(C`Carp\*(C'\fR report the error as coming from a caller not
in \f(CW\*(C`My::Carping::Package\*(C'\fR, nor from \f(CW\*(C`My::Friendly::Caller\*(C'\fR.
.PP
Also read the \*(L"\s-1DESCRIPTION\*(R"\s0 section above, about how \f(CW\*(C`Carp\*(C'\fR decides
where the error is reported from.
.PP
Use \f(CW@CARP_NOT\fR, instead of \f(CW$Carp::CarpLevel\fR.
.PP
Overrides \f(CW\*(C`Carp\*(C'\fR's use of \f(CW@ISA\fR.
.ie n .SS "%Carp::Internal"
.el .SS "\f(CW%Carp::Internal\fP"
.IX Subsection "%Carp::Internal"
This says what packages are internal to Perl.  \f(CW\*(C`Carp\*(C'\fR will never
report an error as being from a line in a package that is internal to
Perl.  For example:
.PP
.Vb 3
\&    $Carp::Internal{ (_\|_PACKAGE_\|_) }++;
\&    # time passes...
\&    sub foo { ... or confess("whatever") };
.Ve
.PP
would give a full stack backtrace starting from the first caller
outside of _\|_PACKAGE_\|_.  (Unless that package was also internal to
Perl.)
.ie n .SS "%Carp::CarpInternal"
.el .SS "\f(CW%Carp::CarpInternal\fP"
.IX Subsection "%Carp::CarpInternal"
This says which packages are internal to Perl's warning system.  For
generating a full stack backtrace this is the same as being internal
to Perl, the stack backtrace will not start inside packages that are
listed in \f(CW%Carp::CarpInternal\fR.  But it is slightly different for
the summary message generated by \f(CW\*(C`carp\*(C'\fR or \f(CW\*(C`croak\*(C'\fR.  There errors
will not be reported on any lines that are calling packages in
\&\f(CW%Carp::CarpInternal\fR.
.PP
For example \f(CW\*(C`Carp\*(C'\fR itself is listed in \f(CW%Carp::CarpInternal\fR.
Therefore the full stack backtrace from \f(CW\*(C`confess\*(C'\fR will not start
inside of \f(CW\*(C`Carp\*(C'\fR, and the short message from calling \f(CW\*(C`croak\*(C'\fR is
not placed on the line where \f(CW\*(C`croak\*(C'\fR was called.
.ie n .SS "$Carp::CarpLevel"
.el .SS "\f(CW$Carp::CarpLevel\fP"
.IX Subsection "$Carp::CarpLevel"
This variable determines how many additional call frames are to be
skipped that would not otherwise be when reporting where an error
occurred on a call to one of \f(CW\*(C`Carp\*(C'\fR's functions.  It is fairly easy
to count these call frames on calls that generate a full stack
backtrace.  However it is much harder to do this accounting for calls
that generate a short message.  Usually people skip too many call
frames.  If they are lucky they skip enough that \f(CW\*(C`Carp\*(C'\fR goes all of
the way through the call stack, realizes that something is wrong, and
then generates a full stack backtrace.  If they are unlucky then the
error is reported from somewhere misleading very high in the call
stack.
.PP
Therefore it is best to avoid \f(CW$Carp::CarpLevel\fR.  Instead use
\&\f(CW@CARP_NOT\fR, \f(CW%Carp::Internal\fR and \f(CW%Carp::CarpInternal\fR.
.PP
Defaults to \f(CW0\fR.
.SH "BUGS"
.IX Header "BUGS"
The Carp routines don't handle exception objects currently.
If called with a first argument that is a reference, they simply
call \fBdie()\fR or \fBwarn()\fR, as appropriate.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
Carp::Always,
Carp::Clan
.SH "CONTRIBUTING"
.IX Header "CONTRIBUTING"
Carp is maintained by the perl 5 porters as part of the core perl 5
version control repository. Please see the perlhack perldoc for how to
submit patches and contribute to it.
.SH "AUTHOR"
.IX Header "AUTHOR"
The Carp module first appeared in Larry Wall's perl 5.000 distribution.
Since then it has been modified by several of the perl 5 porters.
Andrew Main (Zefram) <zefram@fysh.org> divested Carp into an independent
distribution.
.SH "COPYRIGHT"
.IX Header "COPYRIGHT"
Copyright (C) 1994\-2013 Larry Wall
.PP
Copyright (C) 2011, 2012, 2013 Andrew Main (Zefram) <zefram@fysh.org>
.SH "LICENSE"
.IX Header "LICENSE"
This module is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.

Man Man