From fc18ef1ad344a14174332cd04a04d8182ab85d4b Mon Sep 17 00:00:00 2001 From: Frédéric Buclin Date: Wed, 19 Dec 2012 23:52:54 +0100 Subject: Bug 818621: Perl 5.16 complains with "Variable length lookbehind not implemented in regex" when the Example extension is enabled r=dkl a=LpSolit --- extensions/Example/Extension.pm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'extensions') diff --git a/extensions/Example/Extension.pm b/extensions/Example/Extension.pm index 885a8e8ff..c0b3c6210 100644 --- a/extensions/Example/Extension.pm +++ b/extensions/Example/Extension.pm @@ -371,7 +371,13 @@ sub error_catch { my $new_error_msg = "Ah ah, you tried to access $page_id? Good try!"; $new_error_msg = html_quote($new_error_msg); # There are better tools to parse an HTML page, but it's just an example. - $$page =~ s/(?<=).*(?=<\/td>)/$new_error_msg/si; + # Since Perl 5.16, we can no longer write "class" inside look-behind + # assertions, because "ss" is also seen as the german ß character, which + # makes Perl 5.16 complain. The right fix is to use the /aa modifier, + # but it's only understood since Perl 5.14. So the workaround is to write + # "clas[s]" instead of "class". Stupid and ugly hack, but it works with + # all Perl versions. + $$page =~ s/(?<=).*(?=<\/td>)/$new_error_msg/si; } sub flag_end_of_update { -- cgit v1.2.3-24-g4f1b