From: Jarkko Hietaniemi Date: Sat, 13 Sep 2003 11:15:40 +0000 (+0000) Subject: The "perlio: " prefix looks a little odd X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b4581f097130417ce397d3283decd4cd6b448ce9;p=p5sagit%2Fp5-mst-13.2.git The "perlio: " prefix looks a little odd in the few warning/error messages, since no other 'subsystems' have prefixes. p4raw-id: //depot/perl@21208 --- diff --git a/perlio.c b/perlio.c index a716e70..8ea9ade 100644 --- a/perlio.c +++ b/perlio.c @@ -916,7 +916,7 @@ PerlIO_parse_layers(pTHX_ PerlIO_list_t *av, const char *names) char q = ((*s == '\'') ? '"' : '\''); if (ckWARN(WARN_LAYER)) Perl_warner(aTHX_ packWARN(WARN_LAYER), - "perlio: invalid separator character %c%c%c in layer specification list %s", + "Invalid separator character %c%c%c in PerlIO layer specification %s", q, *s, q, s); SETERRNO(EINVAL, LIB_INVARG); return -1; @@ -953,7 +953,7 @@ PerlIO_parse_layers(pTHX_ PerlIO_list_t *av, const char *names) e--; if (ckWARN(WARN_LAYER)) Perl_warner(aTHX_ packWARN(WARN_LAYER), - "perlio: argument list not closed for layer \"%.*s\"", + "Argument list not closed for PerlIO layer \"%.*s\"", (int) (e - s), s); return -1; default: @@ -976,7 +976,7 @@ PerlIO_parse_layers(pTHX_ PerlIO_list_t *av, const char *names) } else { if (warn_layer) - Perl_warner(aTHX_ packWARN(WARN_LAYER), "perlio: unknown layer \"%.*s\"", + Perl_warner(aTHX_ packWARN(WARN_LAYER), "Unknown PerlIO layer \"%.*s\"", (int) llen, s); return -1; } diff --git a/pod/perldiag.pod b/pod/perldiag.pod index f46a70f..37878ff 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -163,6 +163,15 @@ error. that expected a numeric value instead. If you're fortunate the message will 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 you +forgot the ) that closes the argument list. (Layers take care of transforming +data between external and internal representations.) Perl stopped parsing +the 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 be +the 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 some @@ -1331,16 +1340,6 @@ define a C<$VERSION.> (F) You cannot put a repeat count of any kind right after the '/' code. See L. -=item %s "\x%s" does not map to Unicode - -When reading in different encodings Perl tries to map everything -into Unicode characters. The bytes you read in are not legal in -this encoding, for example - - utf8 "\xE4" does not map to Unicode - -if you try to read in the a-diaereses Latin-1 as UTF-8. - =item Don't know how to handle magic of type '%s' (P) The internal handling of magical variables has been cursed. @@ -1650,12 +1649,6 @@ supposed to follow something: a template character or a ()-group. to have existed already, but for some reason it didn't, and had to be created on an emergency basis to prevent a core dump. -=item $* is no longer supported - -(D deprecated) The special variable C<$*>, deprecated in older perls, has -been removed as of 5.9.0 and is no longer supported. You should use the -C and C regexp modifiers instead. - =item Hash %%s missing the % in argument %d of %s() (D deprecated) Really old Perl let you omit the % on hash names in some @@ -1886,6 +1879,13 @@ elements of an attribute list. If the previous attribute had a parenthesised parameter list, perhaps that list was terminated too soon. See L. +=item Invalid separator character %s in PerlIO layer specification %s + +(W layer) When pushing layers onto the Perl I/O system, something other than a +colon or whitespace was seen between the elements of a layer list. +If the previous attribute had a parenthesised parameter list, perhaps that +list was terminated too soon. + =item Invalid type '%s' in %s (F) The given character is not a valid pack or unpack type. @@ -1925,6 +1925,12 @@ with 'useperlio'. (F) Your machine doesn't implement the sockatmark() functionality, neither as a system call or an ioctl call (SIOCATMARK). +=item $* is no longer supported + +(D deprecated) The special variable C<$*>, deprecated in older perls, has +been removed as of 5.9.0 and is no longer supported. You should use the +C and C regexp modifiers instead. + =item `%s' is not a code reference (W overload) The second (fourth, sixth, ...) argument of overload::constant @@ -2857,31 +2863,6 @@ redirected it with select().) "Can't locate object method \"%s\" via package \"%s\"". It often means that a method requires a package that has not been loaded. -=item perlio: argument list not closed for layer "%s" - -(W layer) When pushing a layer with arguments onto the Perl I/O system you -forgot the ) that closes the argument list. (Layers take care of transforming -data between external and internal representations.) Perl stopped parsing -the 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 be -the result of the value of the environment variable PERLIO. - -=item perlio: invalid separator character %s in layer specification list %s - -(W layer) When pushing layers onto the Perl I/O system, something other than a -colon or whitespace was seen between the elements of a layer list. -If the previous attribute had a parenthesised parameter list, perhaps that -list was terminated too soon. - -=item perlio: unknown layer "%s" - -(W layer) An attempt was made to push an unknown layer onto the Perl I/O -system. (Layers take care of transforming data between external and -internal representations.) Note that some layers, such as C, -are not supported in all environments. If your program didn't -explicitly request the failing operation, it may be the result of the -value of the environment variable PERLIO. - =item Perl %s required--this is only version %s, stopped (F) The module in question uses features of a version of Perl more @@ -3893,6 +3874,15 @@ order. of valid modes: C<< < >>, C<< > >>, C<<< >> >>>, C<< +< >>, C<< +> >>, C<<< +>> >>>, C<-|>, C<|->, C<< <& >>, C<< >& >>. +=item Unknown PerlIO layer "%s" + +(W layer) An attempt was made to push an unknown layer onto the Perl I/O +system. (Layers take care of transforming data between external and +internal representations.) Note that some layers, such as C, +are not supported in all environments. If your program didn't +explicitly request the failing operation, it may be the result of the +value of the environment variable PERLIO. + =item Unknown process %x sent message to prime_env_iter: %s (P) An error peculiar to VMS. Perl was reading values for %ENV before @@ -4089,6 +4079,12 @@ must be written as The <-- HERE shows in the regular expression about where the problem was discovered. See L. +=item Useless localization of %s + +(W syntax) The localization of lvalues such as C is +legal, but in fact the local() currently has no effect. This may change at +some point in the future, but in the meantime such code is discouraged. + =item Useless (?%s) - use /%s modifier in regex; marked by <-- HERE in m/%s/ (W regexp) You have used an internal modifier such as (?o) that has no @@ -4103,12 +4099,6 @@ must be written as The <-- HERE shows in the regular expression about where the problem was discovered. See L. -=item Useless localization of %s - -(W syntax) The localization of lvalues such as C is -legal, but in fact the local() currently has no effect. This may change at -some point in the future, but in the meantime such code is discouraged. - =item Useless use of %s in void context (W void) You did something without a side effect in a context that does @@ -4364,28 +4354,6 @@ C operator. longer than 1024 characters. The return value has been truncated to 1024 characters. -=item Variable "%s" is not imported%s - -(F) While "use strict" in effect, you referred to a global variable that -you apparently thought was imported from another module, because -something else of the same name (usually a subroutine) is exported by -that module. It usually means you put the wrong funny character on the -front of your variable. - -=item Variable length lookbehind not implemented in regex; marked by <-- HERE in m/%s/ - -(F) Lookbehind is allowed only for subexpressions whose length is fixed and -known at compile time. The <-- HERE shows in the regular expression about -where the problem was discovered. See L. - -=item "%s" variable %s masks earlier declaration in same %s - -(W misc) A "my" or "our" variable has been redeclared in the current -scope or statement, effectively eliminating all access to the previous -instance. This is almost always a typographical error. Note that the -earlier variable will still exist until the end of the scope or until -all closure referents to it are destroyed. - =item Variable "%s" is not available (W closure) During compilation, an inner named subroutine or eval is @@ -4416,6 +4384,28 @@ gone out of scope, for example, Here, when the '$a' in the eval is being compiled, f() is not currently being executed, so its $a is not available for capture. +=item Variable "%s" is not imported%s + +(F) While "use strict" in effect, you referred to a global variable that +you apparently thought was imported from another module, because +something else of the same name (usually a subroutine) is exported by +that module. It usually means you put the wrong funny character on the +front of your variable. + +=item Variable length lookbehind not implemented in regex; marked by <-- HERE in m/%s/ + +(F) Lookbehind is allowed only for subexpressions whose length is fixed and +known at compile time. The <-- HERE shows in the regular expression about +where the problem was discovered. See L. + +=item "%s" variable %s masks earlier declaration in same %s + +(W misc) A "my" or "our" variable has been redeclared in the current +scope or statement, effectively eliminating all access to the previous +instance. This is almost always a typographical error. Note that the +earlier variable will still exist until the end of the scope or until +all closure referents to it are destroyed. + =item Variable syntax (A) You've accidentally run your script through B instead @@ -4507,6 +4497,16 @@ of the codes @, /, U, u, w or a *-length. Redesign the template. (W closed) The filehandle you're writing to got itself closed sometime before now. Check your control flow. +=item %s "\x%s" does not map to Unicode + +When reading in different encodings Perl tries to map everything +into Unicode characters. The bytes you read in are not legal in +this encoding, for example + + utf8 "\xE4" does not map to Unicode + +if you try to read in the a-diaereses Latin-1 as UTF-8. + =item 'X' outside of string (F) You had a (un)pack template that specified a relative position before diff --git a/t/io/open.t b/t/io/open.t index 90305bd..e71d2ec 100755 --- a/t/io/open.t +++ b/t/io/open.t @@ -286,19 +286,19 @@ SKIP: { local $SIG{__WARN__} = sub { $w = shift }; eval { open(F, ">>>", "afile") }; - like($w, qr/perlio: invalid separator character '>' in layer spec/, + like($w, qr/Invalid separator character '>' in PerlIO layer spec/, "bad open (>>>) warning"); like($@, qr/Unknown open\(\) mode '>>>'/, "bad open (>>>) failure"); eval { open(F, ">:u", "afile" ) }; - like($w, qr/perlio: unknown layer "u"/, + like($w, qr/Unknown PerlIO layer "u"/, 'bad layer ">:u" warning'); eval { open(F, "<:u", "afile" ) }; - like($w, qr/perlio: unknown layer "u"/, + like($w, qr/Unknown PerlIO layer "u"/, 'bad layer "<:u" warning'); - eval { open(F, ":u", "afile" ) }; - like($@, qr/Unknown open\(\) mode ':u'/, - 'bad layer ":u" failure'); + eval { open(F, ":c", "afile" ) }; + like($@, qr/Unknown open\(\) mode ':c'/, + 'bad layer ":c" failure'); }