Skip Menu |

This queue is for tickets about the Chemistry-Mol CPAN distribution.

Report information
The Basics
Id: 115215
Status: open
Priority: 0/
Queue: Chemistry-Mol

People
Owner: Nobody in particular
Requestors: SREZIC [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.37
Fixed in: (no value)



Subject: Unescaped left brace in regex is illegal in regex
perl 5.25.1 introduced a change which requires to escape all { in regexps. This change breaks the compilation of Chemistry/File/Formula.pm: ... Unescaped left brace in regex is illegal in regex; marked by <-- HERE in m/(?<!\\)%j{ <-- HERE (.*?)}/ at /home/cpansand/.cpan/build/2016060918/Chemistry-Mol-0.37-9m68T7/blib/lib/Chemistry/File/Formula.pm line 203. Compilation failed in require at t/Bond.t line 5. BEGIN failed--compilation aborted at t/Bond.t line 5. t/Bond.t ............ Dubious, test returned 255 (wstat 65280, 0xff00) No subtests run ...
On Thu Jun 09 14:04:55 2016, SREZIC wrote: Show quoted text
> perl 5.25.1 introduced a change which requires to escape all { in > regexps. This change breaks the compilation of > Chemistry/File/Formula.pm: > > ... > Unescaped left brace in regex is illegal in regex; marked by <-- HERE > in m/(?<!\\)%j{ <-- HERE (.*?)}/ at > /home/cpansand/.cpan/build/2016060918/Chemistry-Mol-0.37- > 9m68T7/blib/lib/Chemistry/File/Formula.pm line 203. > Compilation failed in require at t/Bond.t line 5. > BEGIN failed--compilation aborted at t/Bond.t line 5. > t/Bond.t ............ > Dubious, test returned 255 (wstat 65280, 0xff00) > No subtests run > ...
Applying a patch along the lines of the attachment should resolve the problem. Thank you very much. Jim Keenan
Subject: Chemistry-Mol-unrecognized-left-brace.diff
diff -u -r File/Formula.pm blib/lib/Chemistry/File/Formula.pm --- File/Formula.pm 2009-05-10 15:37:59.000000000 -0400 +++ blib/lib/Chemistry/File/Formula.pm 2016-12-20 11:06:50.522099876 -0500 @@ -200,7 +200,7 @@ my $fh = $mol->formula_hash; $format =~ s/%%/\\%/g; # escape %% with a \ my $joiner = ""; - $joiner = $1 if $format =~ s/(?<!\\)%j{(.*?)}//; # joiner %j{} + $joiner = $1 if $format =~ s/(?<!\\)%j\{(.*?)}//; # joiner %j{} my @symbols; if ($opts{formula_sort}) {