In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/36195052d1d557ad70ddca695d75e18cb1fc3bbb?hp=d5a163ad1974ba765cb85fdba390c24817141ec4>
- Log ----------------------------------------------------------------- commit 36195052d1d557ad70ddca695d75e18cb1fc3bbb Author: Karl Williamson <[email protected]> Date: Tue Oct 25 10:47:23 2016 -0600 Add branch predictors for DEBUG statements It is unlikely that any given debug flag will be set in any given run, even under DEBUGGING builds. M perl.h commit f60d22a6ab79f5e5d30458c05bb8854e5b6a8a4c Author: Karl Williamson <[email protected]> Date: Tue Oct 25 10:46:42 2016 -0600 perl.h: White-space only M perl.h commit b5eea28922ca2ea8e62b72cfe2b43ff3545c3450 Author: Karl Williamson <[email protected]> Date: Sun Oct 23 22:12:12 2016 -0600 pod/perllocale: Add caution about incompatible locales Some locales aren't compatible with Perl. Note the potential bad consequences of using them. M pod/perllocale.pod commit 6e16fd378454d2be9674eec45d5b26bf0678d524 Author: Karl Williamson <[email protected]> Date: Thu Sep 15 21:52:44 2016 -0600 PATCH: [perl #129277] perlrecharclass: Clarify q// handling See https://rt.perl.org/Ticket/Display.html?id=129277 M pod/perlrecharclass.pod ----------------------------------------------------------------------- Summary of changes: perl.h | 77 +++++++++++++++++++++++++++---------------------- pod/perllocale.pod | 11 +++---- pod/perlrecharclass.pod | 9 +++++- 3 files changed, 57 insertions(+), 40 deletions(-) diff --git a/perl.h b/perl.h index d27754e9af..accc628c3b 100644 --- a/perl.h +++ b/perl.h @@ -4192,34 +4192,34 @@ Gid_t getegid (void); #define DEBUG_DB_RECURSE_FLAG 0x40000000 #define DEBUG_TOP_FLAG 0x80000000 /* -D was given --> PL_debug |= FLAG */ -# define DEBUG_p_TEST_ (PL_debug & DEBUG_p_FLAG) -# define DEBUG_s_TEST_ (PL_debug & DEBUG_s_FLAG) -# define DEBUG_l_TEST_ (PL_debug & DEBUG_l_FLAG) -# define DEBUG_t_TEST_ (PL_debug & DEBUG_t_FLAG) -# define DEBUG_o_TEST_ (PL_debug & DEBUG_o_FLAG) -# define DEBUG_c_TEST_ (PL_debug & DEBUG_c_FLAG) -# define DEBUG_P_TEST_ (PL_debug & DEBUG_P_FLAG) -# define DEBUG_m_TEST_ (PL_debug & DEBUG_m_FLAG) -# define DEBUG_f_TEST_ (PL_debug & DEBUG_f_FLAG) -# define DEBUG_r_TEST_ (PL_debug & DEBUG_r_FLAG) -# define DEBUG_x_TEST_ (PL_debug & DEBUG_x_FLAG) -# define DEBUG_u_TEST_ (PL_debug & DEBUG_u_FLAG) -# define DEBUG_U_TEST_ (PL_debug & DEBUG_U_FLAG) -# define DEBUG_H_TEST_ (PL_debug & DEBUG_H_FLAG) -# define DEBUG_X_TEST_ (PL_debug & DEBUG_X_FLAG) -# define DEBUG_D_TEST_ (PL_debug & DEBUG_D_FLAG) -# define DEBUG_S_TEST_ (PL_debug & DEBUG_S_FLAG) -# define DEBUG_T_TEST_ (PL_debug & DEBUG_T_FLAG) -# define DEBUG_R_TEST_ (PL_debug & DEBUG_R_FLAG) -# define DEBUG_J_TEST_ (PL_debug & DEBUG_J_FLAG) -# define DEBUG_v_TEST_ (PL_debug & DEBUG_v_FLAG) -# define DEBUG_C_TEST_ (PL_debug & DEBUG_C_FLAG) -# define DEBUG_A_TEST_ (PL_debug & DEBUG_A_FLAG) -# define DEBUG_q_TEST_ (PL_debug & DEBUG_q_FLAG) -# define DEBUG_M_TEST_ (PL_debug & DEBUG_M_FLAG) -# define DEBUG_B_TEST_ (PL_debug & DEBUG_B_FLAG) -# define DEBUG_L_TEST_ (PL_debug & DEBUG_L_FLAG) -# define DEBUG_i_TEST_ (PL_debug & DEBUG_i_FLAG) +# define DEBUG_p_TEST_ UNLIKELY(PL_debug & DEBUG_p_FLAG) +# define DEBUG_s_TEST_ UNLIKELY(PL_debug & DEBUG_s_FLAG) +# define DEBUG_l_TEST_ UNLIKELY(PL_debug & DEBUG_l_FLAG) +# define DEBUG_t_TEST_ UNLIKELY(PL_debug & DEBUG_t_FLAG) +# define DEBUG_o_TEST_ UNLIKELY(PL_debug & DEBUG_o_FLAG) +# define DEBUG_c_TEST_ UNLIKELY(PL_debug & DEBUG_c_FLAG) +# define DEBUG_P_TEST_ UNLIKELY(PL_debug & DEBUG_P_FLAG) +# define DEBUG_m_TEST_ UNLIKELY(PL_debug & DEBUG_m_FLAG) +# define DEBUG_f_TEST_ UNLIKELY(PL_debug & DEBUG_f_FLAG) +# define DEBUG_r_TEST_ UNLIKELY(PL_debug & DEBUG_r_FLAG) +# define DEBUG_x_TEST_ UNLIKELY(PL_debug & DEBUG_x_FLAG) +# define DEBUG_u_TEST_ UNLIKELY(PL_debug & DEBUG_u_FLAG) +# define DEBUG_U_TEST_ UNLIKELY(PL_debug & DEBUG_U_FLAG) +# define DEBUG_H_TEST_ UNLIKELY(PL_debug & DEBUG_H_FLAG) +# define DEBUG_X_TEST_ UNLIKELY(PL_debug & DEBUG_X_FLAG) +# define DEBUG_D_TEST_ UNLIKELY(PL_debug & DEBUG_D_FLAG) +# define DEBUG_S_TEST_ UNLIKELY(PL_debug & DEBUG_S_FLAG) +# define DEBUG_T_TEST_ UNLIKELY(PL_debug & DEBUG_T_FLAG) +# define DEBUG_R_TEST_ UNLIKELY(PL_debug & DEBUG_R_FLAG) +# define DEBUG_J_TEST_ UNLIKELY(PL_debug & DEBUG_J_FLAG) +# define DEBUG_v_TEST_ UNLIKELY(PL_debug & DEBUG_v_FLAG) +# define DEBUG_C_TEST_ UNLIKELY(PL_debug & DEBUG_C_FLAG) +# define DEBUG_A_TEST_ UNLIKELY(PL_debug & DEBUG_A_FLAG) +# define DEBUG_q_TEST_ UNLIKELY(PL_debug & DEBUG_q_FLAG) +# define DEBUG_M_TEST_ UNLIKELY(PL_debug & DEBUG_M_FLAG) +# define DEBUG_B_TEST_ UNLIKELY(PL_debug & DEBUG_B_FLAG) +# define DEBUG_L_TEST_ UNLIKELY(PL_debug & DEBUG_L_FLAG) +# define DEBUG_i_TEST_ UNLIKELY(PL_debug & DEBUG_i_FLAG) # define DEBUG_Xv_TEST_ (DEBUG_X_TEST_ && DEBUG_v_TEST_) # define DEBUG_Uv_TEST_ (DEBUG_U_TEST_ && DEBUG_v_TEST_) # define DEBUG_Pv_TEST_ (DEBUG_P_TEST_ && DEBUG_v_TEST_) @@ -4274,21 +4274,30 @@ Gid_t getegid (void); /* Temporarily turn off memory debugging in case the a * does memory allocation, either directly or indirectly. */ # define DEBUG_m(a) \ - STMT_START { \ - if (PERL_GET_INTERP) { dTHX; if (DEBUG_m_TEST) {PL_debug&=~DEBUG_m_FLAG; a; PL_debug|=DEBUG_m_FLAG;} } \ + STMT_START { \ + if (PERL_GET_INTERP) { \ + dTHX; \ + if (DEBUG_m_TEST) { \ + PL_debug &= ~DEBUG_m_FLAG; \ + a; \ + PL_debug |= DEBUG_m_FLAG; \ + } \ + } \ } STMT_END -# define DEBUG__(t, a) \ - STMT_START { \ - if (t) STMT_START {a;} STMT_END; \ - } STMT_END +# define DEBUG__(t, a) \ + STMT_START { \ + if (t) STMT_START {a;} STMT_END; \ + } STMT_END # define DEBUG_f(a) DEBUG__(DEBUG_f_TEST, a) + #ifndef PERL_EXT_RE_BUILD # define DEBUG_r(a) DEBUG__(DEBUG_r_TEST, a) #else # define DEBUG_r(a) STMT_START {a;} STMT_END #endif /* PERL_EXT_RE_BUILD */ + # define DEBUG_x(a) DEBUG__(DEBUG_x_TEST, a) # define DEBUG_u(a) DEBUG__(DEBUG_u_TEST, a) # define DEBUG_U(a) DEBUG__(DEBUG_U_TEST, a) diff --git a/pod/perllocale.pod b/pod/perllocale.pod index dee4cb53e6..44da58f76e 100644 --- a/pod/perllocale.pod +++ b/pod/perllocale.pod @@ -909,11 +909,12 @@ pattern matching using the C<i> modifier. Starting in v5.20, Perl supports UTF-8 locales for C<LC_CTYPE>, but otherwise Perl only supports single-byte locales, such as the ISO 8859 series. This means that wide character locales, for example for Asian -languages, are not well-supported. (If the platform has the capability -for Perl to detect such a locale, starting in Perl v5.22, -L<Perl will warn, default enabled|warnings/Category Hierarchy>, -using the C<locale> warning category, whenever such a locale is switched -into.) The UTF-8 locale support is actually a +languages, are not well-supported. Use of these locales may cause core +dumps. If the platform has the capability for Perl to detect such a +locale, starting in Perl v5.22, L<Perl will warn, default +enabled|warnings/Category Hierarchy>, using the C<locale> warning +category, whenever such a locale is switched into. The UTF-8 locale +support is actually a superset of POSIX locales, because it is really full Unicode behavior as if no C<LC_CTYPE> locale were in effect at all (except for tainting; see L</SECURITY>). POSIX locales, even UTF-8 ones, diff --git a/pod/perlrecharclass.pod b/pod/perlrecharclass.pod index 89f4a7ef3f..93bb2e5e63 100644 --- a/pod/perlrecharclass.pod +++ b/pod/perlrecharclass.pod @@ -512,7 +512,14 @@ is, characters that carry a special meaning like C<.>, C<*>, or C<(>) lose their special meaning and can be used inside a character class without the need to escape them. For instance, C<[()]> matches either an opening parenthesis, or a closing parenthesis, and the parens inside the character -class don't group or capture. +class don't group or capture. Be aware that, unless the pattern is +evaluated in single-quotish context, variable interpolation will take +place before the bracketed class is parsed: + + $, = "\t| "; + $a =~ m'[$,]'; # single-quotish: matches '$' or ',' + $a =~ q{[$,]}' # same + $a =~ m/[$,]/; # double-quotish: matches "\t", "|", or " " Characters that may carry a special meaning inside a character class are: C<\>, C<^>, C<->, C<[> and C<]>, and are discussed below. They can be -- Perl5 Master Repository
