Subject: | Unescaped left brace in regex is deprecated |
This module warns when used with Perl 5.22.
% perl -w -e 'use LaTeX::Decode'
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/\\dings{ <-- HERE ([2-9AF][0-9A-F])}/ at /usr/share/perl5/LaTeX/Decode.pm line 133.
Proposed patch attached.
Subject: | 0001-Fix-regexp-syntax-for-Perl-5.22.patch |
From 03561b7d0364c17896ee2cc6de22734e70788093 Mon Sep 17 00:00:00 2001
From: Niko Tyni <ntyni@debian.org>
Date: Sun, 27 Dec 2015 22:23:19 +0200
Subject: [PATCH] Fix regexp syntax for Perl 5.22
Unescaped left brace in regex is deprecated, passed through in regex
Bug-Debian: https://bugs.debian.org/809098
---
lib/LaTeX/Decode.pm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/LaTeX/Decode.pm b/lib/LaTeX/Decode.pm
index 7741405..92fef90 100644
--- a/lib/LaTeX/Decode.pm
+++ b/lib/LaTeX/Decode.pm
@@ -130,7 +130,7 @@ sub latex_decode {
$text =~ s/\\not\\($NEG_SYMB_RE)/$NEGATEDSYMBOLS{$1}/ge;
$text =~ s/\\textsuperscript{($SUPER_RE)}/$SUPERSCRIPTS{$1}/ge;
$text =~ s/\\textsuperscript{\\($SUPERCMD_RE)}/$CMDSUPERSCRIPTS{$1}/ge;
- $text =~ s/\\dings{([2-9AF][0-9A-F])}/$DINGS{$1}/ge;
+ $text =~ s/\\dings\{([2-9AF][0-9A-F])}/$DINGS{$1}/ge;
}
$text =~ s/(\\[a-zA-Z]+)\\(\s+)/$1\{\}$2/g; # \foo\ bar -> \foo{} bar
--
2.6.4