Permalink
Browse files

unescaped braces in regex is deprecated in 5.17+

perl 5.17.0 and up deprecate the use of unescaped braces inside regular expressions, triggering a warning every time they see it (one that will, in time, become an error). This patch updates Text::Haml to newer perls :)
  • Loading branch information...
1 parent a1e815f commit 00a77abeb98e31a7a964420a766430733b28cc1a @garu garu committed Jul 30, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/Text/Haml.pm
View
@@ -889,11 +889,11 @@ sub _parse_text {
my $t;
my $escape = 0;
my $found = 0;
- if ($text =~ s/^(.*?)?(?<!\\)\#{//) {
+ if ($text =~ s/^(.*?)?(?<!\\)\#\{//) {
$found = 1;
$t = $1;
}
- elsif ($text =~ s/^(.*?)?\\\\\#{//) {
+ elsif ($text =~ s/^(.*?)?\\\\\#\{//) {
$found = 1;
$t = $1;
$escape = 1;
@@ -905,7 +905,7 @@ sub _parse_text {
}
if ($found) {
- $text =~ s/^([^}]+)}//;
+ $text =~ s/^([^}]+)\}//;
my $prefix = $escape ? quotemeta("\\") : '';
$output .= qq/$prefix".$1."/;

0 comments on commit 00a77ab

Please sign in to comment.