From 43fe5a964c933b3a64373a60593450a4a231df8e Mon Sep 17 00:00:00 2001 From: Tokuhiro Matsuno Date: Mon, 25 Jul 2011 13:04:11 +0900 Subject: [PATCH] support perl 5.14+, that is "Stringification of regexes has changed". See also http://search.cpan.org/dist/perl-5.14.0/pod/perldelta.pod#Stringification_of_regexes_has_changed --- lib/Lingua/JA/Kana.pm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/Lingua/JA/Kana.pm b/lib/Lingua/JA/Kana.pm index 4f73c23..8ae9466 100644 --- a/lib/Lingua/JA/Kana.pm +++ b/lib/Lingua/JA/Kana.pm @@ -5,6 +5,7 @@ use utf8; our $VERSION = sprintf "%d.%02d", q$Revision: 0.5 $ =~ /(\d+)/g; +use re (); require Exporter; use base qw/Exporter/; our @EXPORT = qw( @@ -121,8 +122,13 @@ our $Re_Romaji2Kata = do { my $ra = Regexp::Assemble->new(); $ra->add($_) for keys %Romaji2Kata; my $str = $ra->re; - substr( $str, 0, 8, '' ); # remove '(?-xism:' - substr( $str, -1, 1, '' ); # and ')'; + if ($] >= 5.009005) { + my ($pattern, $mod) = re::regexp_pattern($str); + $str = $pattern; + } else { + substr( $str, 0, 8, '' ); # remove '(?-xism:' + substr( $str, -1, 1, '' ); # and ')'; + } qr/$str/i; # and recompile with i } else {