perldiag.pod

来自「视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.」· POD 代码 · 共 1,814 行 · 第 1/5 页

POD
1,814
字号
=head1 NAMEperldiag - various Perl diagnostics=head1 DESCRIPTIONThese messages are classified as follows (listed in increasing order ofdesperation):    (W) A warning (optional).    (D) A deprecation (optional).    (S) A severe warning (enabled by default).    (F) A fatal error (trappable).    (P) An internal error you should never see (trappable).    (X) A very fatal error (nontrappable).    (A) An alien error message (not generated by Perl).The majority of messages from the first three classifications above(W, D & S) can be controlled using the C<warnings> pragma.If a message can be controlled by the C<warnings> pragma, its warningcategory is included with the classification letter in the descriptionbelow.Optional warnings are enabled by using the C<warnings> pragma or the B<-w>and B<-W> switches. Warnings may be captured by setting C<$SIG{__WARN__}>to a reference to a routine that will be called on each warning insteadof printing it.  See L<perlvar>.Severe warnings are always enabled, unless they are explicitly disabledwith the C<warnings> pragma or the B<-X> switch.Trappable errors may be trapped using the eval operator.  SeeL<perlfunc/eval>.  In almost all cases, warnings may be selectivelydisabled or promoted to fatal errors using the C<warnings> pragma.See L<warnings>.The messages are in alphabetical order, without regard to upper orlower-case.  Some of these messages are generic.  Spots that vary aredenoted with a %s or other printf-style escape.  These escapes areignored by the alphabetical order, as are all characters other thanletters.  To look up your message, just ignore anything that is not aletter.=over 4=item accept() on closed socket %s(W closed) You tried to do an accept on a closed socket.  Did you forgetto check the return value of your socket() call?  SeeL<perlfunc/accept>.=item Allocation too large: %lx(X) You can't allocate more than 64K on an MS-DOS machine.=item '%c' allowed only after types %s(F) The modifiers '!', '<' and '>' are allowed in pack() or unpack() onlyafter certain types.  See L<perlfunc/pack>.=item Ambiguous call resolved as CORE::%s(), qualify as such or use &(W ambiguous) A subroutine you have declared has the same name as a Perlkeyword, and you have used the name without qualification for callingone or the other.  Perl decided to call the builtin because thesubroutine is not imported.To force interpretation as a subroutine call, either put an ampersandbefore the subroutine name, or qualify the name with its package.Alternatively, you can import the subroutine (or pretend that it'simported with the C<use subs> pragma).To silently interpret it as the Perl operator, use the C<CORE::> prefixon the operator (e.g. C<CORE::log($x)>) or declare the subroutineto be an object method (see L<perlsub/"Subroutine Attributes"> orL<attributes>).=item Ambiguous range in transliteration operator(F) You wrote something like C<tr/a-z-0//> which doesn't mean anything atall.  To include a C<-> character in a transliteration, put it eitherfirst or last.  (In the past, C<tr/a-z-0//> was synonymous withC<tr/a-y//>, which was probably not what you would have expected.)=item Ambiguous use of %s resolved as %s(W ambiguous)(S) You said something that may not be interpreted the wayyou thought.  Normally it's pretty easy to disambiguate it by supplyinga missing quote, operator, parenthesis pair or declaration.=item '|' and '<' may not both be specified on command line(F) An error peculiar to VMS.  Perl does its own command lineredirection, and found that STDIN was a pipe, and that you also tried toredirect STDIN using '<'.  Only one STDIN stream to a customer, please.=item '|' and '>' may not both be specified on command line(F) An error peculiar to VMS.  Perl does its own command lineredirection, and thinks you tried to redirect stdout both to a file andinto a pipe to another command.  You need to choose one or the other,though nothing's stopping you from piping into a program or Perl scriptwhich 'splits' output into two streams, such as    open(OUT,">$ARGV[0]") or die "Can't write to $ARGV[0]: $!";    while (<STDIN>) {        print;        print OUT;    }    close OUT;=item Applying %s to %s will act on scalar(%s)(W misc) The pattern match (C<//>), substitution (C<s///>), andtransliteration (C<tr///>) operators work on scalar values.  If you applyone of them to an array or a hash, it will convert the array or hash toa scalar value -- the length of an array, or the population info of ahash -- and then work on that scalar value.  This is probably not whatyou meant to do.  See L<perlfunc/grep> and L<perlfunc/map> foralternatives.=item Args must match #! line(F) The setuid emulator requires that the arguments Perl was invokedwith match the arguments specified on the #! line.  Since some systemsimpose a one-argument limit on the #! line, try combining switches;for example, turn C<-w -U> into C<-wU>.=item Arg too short for msgsnd(F) msgsnd() requires a string at least as long as sizeof(long).=item %s argument is not a HASH or ARRAY element(F) The argument to exists() must be a hash or array element or asubroutine with an ampersand, such as:    $foo{$bar}    $ref->{"susie"}[12]    &do_something=item %s argument is not a HASH or ARRAY element or slice(F) The argument to delete() must be either a hash or array element,such as:    $foo{$bar}    $ref->{"susie"}[12]or a hash or array slice, such as:    @foo[$bar, $baz, $xyzzy]    @{$ref->[12]}{"susie", "queue"}=item %s argument is not a subroutine name(F) The argument to exists() for C<exists &sub> must be a subroutinename, and not a subroutine call.  C<exists &sub()> will generate thiserror.=item Argument "%s" isn't numeric%s(W numeric) The indicated string was fed as an argument to an operatorthat expected a numeric value instead.  If you're fortunate the messagewill identify which operator was so unfortunate.=item Argument list not closed for PerlIO layer "%s"(W layer) When pushing a layer with arguments onto the Perl I/O system youforgot the ) that closes the argument list.  (Layers take care of transformingdata between external and internal representations.)  Perl stopped parsingthe layer list at this point and did not attempt to push this layer.If your program didn't explicitly request the failing operation, it may bethe result of the value of the environment variable PERLIO.=item Array @%s missing the @ in argument %d of %s()(D deprecated) Really old Perl let you omit the @ on array names in somespots.  This is now heavily deprecated.=item assertion botched: %s(P) The malloc package that comes with Perl had an internal failure.=item Assertion failed: file "%s"(P) A general assertion failed.  The file in question must be examined.=item Assignment to both a list and a scalar(F) If you assign to a conditional operator, the 2nd and 3rd argumentsmust either both be scalars or both be lists.  Otherwise Perl won'tknow which context to supply to the right side.=item A thread exited while %d threads were running(W threads)(S) When using threaded Perl, a thread (not necessarily the mainthread) exited while there were still other threads running.Usually it's a good idea to first collect the return values of thecreated threads by joining them, and only then exit from the mainthread.  See L<threads>.=item Attempt to access disallowed key '%s' in a restricted hash(F) The failing code has attempted to get or set a key which is not inthe current set of allowed keys of a restricted hash.=item Attempt to bless into a reference(F) The CLASSNAME argument to the bless() operator is expected to bethe name of the package to bless the resulting object into. You'vesupplied instead a reference to something: perhaps you wrote    bless $self, $proto;when you intended    bless $self, ref($proto) || $proto;If you actually want to bless into the stringified versionof the reference supplied, you need to stringify it yourself, forexample by:    bless $self, "$proto";=item Attempt to delete disallowed key '%s' from a restricted hash(F) The failing code attempted to delete from a restricted hash a keywhich is not in its key set.=item Attempt to delete readonly key '%s' from a restricted hash(F) The failing code attempted to delete a key whose value has beendeclared readonly from a restricted hash.=item Attempt to free non-arena SV: 0x%lx(P internal) All SV objects are supposed to be allocated from arenasthat will be garbage collected on exit.  An SV was discovered to beoutside any of those arenas.=item Attempt to free nonexistent shared string(P internal) Perl maintains a reference counted internal table ofstrings to optimize the storage and access of hash keys and otherstrings.  This indicates someone tried to decrement the reference countof a string that can no longer be found in the table.=item Attempt to free temp prematurely(W debugging) Mortalized values are supposed to be freed by thefree_tmps() routine.  This indicates that something else is freeing theSV before the free_tmps() routine gets a chance, which means that thefree_tmps() routine will be freeing an unreferenced scalar when it doestry to free it.=item Attempt to free unreferenced glob pointers(P internal) The reference counts got screwed up on symbol aliases.=item Attempt to free unreferenced scalar(W internal) Perl went to decrement the reference count of a scalar tosee if it would go to 0, and discovered that it had already gone to 0earlier, and should have been freed, and in fact, probably was freed.This could indicate that SvREFCNT_dec() was called too many times, orthat SvREFCNT_inc() was called too few times, or that the SV wasmortalized when it shouldn't have been, or that memory has beencorrupted.=item Attempt to join self(F) You tried to join a thread from within itself, which is animpossible task.  You may be joining the wrong thread, or you may needto move the join() to some other thread.=item Attempt to pack pointer to temporary value(W pack) You tried to pass a temporary value (like the result of afunction, or a computed expression) to the "p" pack() template.  Thismeans the result contains a pointer to a location that could becomeinvalid anytime, even before the end of the current statement.  Useliterals or global values as arguments to the "p" pack() template toavoid this warning.=item Attempt to reload %s aborted.(F) You tried to load a file with C<use> or C<require> that failed tocompile once already.  Perl will not try to compile this file againunless you delete its entry from %INC.  See L<perlfunc/require> andL<perlvar/%INC>.=item Attempt to set length of freed array(W) You tried to set the length of an array which has been freed.  Youcan do this by storing a reference to the scalar representing the last indexof an array and later assigning through that reference. For example    $r = do {my @a; \$#a};    $$r = 503=item Attempt to use reference as lvalue in substr(W substr) You supplied a reference as the first argument to substr()used as an lvalue, which is pretty strange.  Perhaps you forgot todereference it first.  See L<perlfunc/substr>.=item Bad arg length for %s, is %d, should be %s(F) You passed a buffer of the wrong size to one of msgctl(), semctl()or shmctl().  In C parlance, the correct sizes are, respectively,S<sizeof(struct msqid_ds *)>, S<sizeof(struct semid_ds *)>, andS<sizeof(struct shmid_ds *)>.=item Bad evalled substitution pattern(F) You've used the C</e> switch to evaluate the replacement for asubstitution, but perl found a syntax error in the code to evaluate,most likely an unexpected right brace '}'.=item Bad filehandle: %s(F) A symbol was passed to something wanting a filehandle, but thesymbol has no filehandle associated with it.  Perhaps you didn't do anopen(), or did it in another package.=item Bad free() ignored(S malloc) An internal routine called free() on something that had neverbeen malloc()ed in the first place. Mandatory, but can be disabled bysetting environment variable C<PERL_BADFREE> to 0.This message can be seen quite often with DB_File on systems with "hard"dynamic linking, like C<AIX> and C<OS/2>. It is a bug of C<Berkeley DB>which is left unnoticed if C<DB> uses I<forgiving> system malloc().=item Bad hash(P) One of the internal hash routines was passed a null HV pointer.=item Badly placed ()'s(A) You've accidentally run your script through B<csh> insteadof Perl.  Check the #! line, or manually feed your script intoPerl yourself.=item Bad name after %s::(F) You started to name a symbol by using a package prefix, and thendidn't finish the symbol.  In particular, you can't interpolate outsideof quotes, so    $var = 'myvar';    $sym = mypack::$var;is not the same as    $var = 'myvar';    $sym = "mypack::$var";=item Bad realloc() ignored

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?