In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/e23837fbaecd33f5802df8225c71bd62cee30314?hp=3d7a9343ce805daaa050171aecb0ab4f37fed18d>
- Log ----------------------------------------------------------------- commit e23837fbaecd33f5802df8225c71bd62cee30314 Author: Karl Williamson <pub...@khwilliamson.com> Date: Fri Sep 24 08:46:12 2010 -0600 perldelta: Note Perl version of regexp_pattern() perldelta suggests using this, but it didn't come into being until 5.9.5, so cpan modules may not be able to use it. ----------------------------------------------------------------------- Summary of changes: pod/perldelta.pod | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pod/perldelta.pod b/pod/perldelta.pod index 288691e..b2d2313 100644 --- a/pod/perldelta.pod +++ b/pod/perldelta.pod @@ -72,7 +72,7 @@ not have to change (after this one time), as the stringification will automatically incorporate the new modifiers. Code that needs to work properly with both old- and new-style regexes -can avoid the whole issue by using: +can avoid the whole issue by using (for Perls since 5.9.5): use re qw(regexp_pattern); my ($pat, $mods) = regexp_pattern($re_ref); @@ -82,8 +82,8 @@ return, C<$mods> will be a string containing all the non-default modifiers used when the regular expression was compiled, and C<$pattern> the actual pattern. -If the actual stringification is important, you can use something like -the following: +If the actual stringification is important, or older Perls need to be +supported, you can use something like the following: # Accept both old and new-style stringification my $modifiers = (qr/foobar/ =~ /\Q(?^/) ? '^' : '-xism'; -- Perl5 Master Repository