you have also specified an explicit size for the string. See
L<perlfunc/pack>.
-=item "\c%c" more clearly written simply as "%c"
+=item "\c%c" more clearly written simply as "%s"
(D deprecated) The C<\cI<X>> construct is intended to be a way to specify
non-printable characters. You used it for a printable one, which is better
-written as simply itself.
+written as simply itself, perhaps preceded by a backslash for non-word
+characters. This message may not remain as Deprecated beyond 5.13.
=item Deep recursion on subroutine "%s"
is ("\x{10FFFD}", chr 1114109);
# These kludged tests should change when we remove the temporary fatal error
-# in util.c for "\c{"
+# in util.c for "\c{". And, the warning there should probably not be
+# deprecated; See [perl #75138].
# BE SURE TO remove the message from the __DATA__ section of porting/diag.t,
-# and to verify the messages in util.c are adequately covered in perldiag.pod
+# and to verify the messages in util.c are adequately covered in
+# perldiag.pod, and to revise the explanatory wording that is there now.
my $value = eval '"\c{ACK}"';
if ($^V lt v5.13.0 || $^V ge v5.14.0) {
is ($@, "");
is ($value, ";ACK}");
}
-elsif ($@ ne "") { # 5.13 series, should fail
- is ("1", "1"); # This .t only has 'is' at its disposal
+elsif ($@ ne "") { # 5.13 series, expect the eval to fail, so pass it.
+ is ("1", "1"); # This .t only has 'is' at its disposal
is ("1", "1");
-}
+}
else { # Something wrong; someone has removed the failure in util.c
is ("Should fail for 5.13 until fix test", "0");
is ("1", "1");
# Verify works in single quotish context; regex compiler delivers slightly different msg
# \N{U+BEEF.BEAD} succeeds here, because can't completely hide it from the outside.
\N{U+0xBEEF} - c - Invalid hexadecimal number
+\c` - c - \"\\c`\" more clearly written simply as \"\\ \"
+\c1 - c - \"\\c1\" more clearly written simply as \"q\"
+\cA \001 y $& \1
# vim: set noexpandtab
Perl_croak(aTHX_ "It is proposed that \"\\c{\" no longer be valid. It has historically evaluated to\n \";\". If you disagree with this proposal, send email to perl5-porters@perl.org\nOtherwise, or in the meantime, you can work around this failure by changing\n\"\\c{\" to \";\"");
}
else if (output_warning) {
+ U8 clearer[3];
+ U8 i = 0;
+ if (! isALNUM(result)) {
+ clearer[i++] = '\\';
+ }
+ clearer[i++] = result;
+ clearer[i++] = '\0';
+
Perl_ck_warner_d(aTHX_ packWARN(WARN_DEPRECATED),
- "\"\\c%c\" more clearly written simply as \"%c\"",
+ "\"\\c%c\" more clearly written simply as \"%s\"",
source,
- result);
+ clearer);
}
}