Skip Menu |

This queue is for tickets about the Text-Balanced CPAN distribution.

Report information
The Basics
Id: 96542
Status: open
Priority: 0/
Queue: Text-Balanced

People
Owner: Nobody in particular
Requestors: hakim.cassimally [...] gmail.com
Cc:
AdminCc:

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



Subject: extract_codeblock fat-comma parsing broken by over-eager quotelike { y => $y }
For trying to parse a hashref, extract_codeblock looks superficially attractive. However, the quotelike parsing is too eager to match y => as the quotelike operator y=...= So: $ extract_codeblock '{ x => $x, y => $y}, { x => $x2, y => $y2 }' $VAR1 = '{ x => $x, y => $y}, { x => $x2, y => $y2 }'; $VAR2 = ''; $VAR3 = ''; Whereas I'd have expected a behaviour more similar to: $ extract_bracketed '{ x => $x, y => $y}, { x => $x2, y => $y2 }', '{}' $VAR1 = '{ x => $x, y => $y}'; $VAR2 = ', { x => $x2, y => $y2 }'; $VAR3 = ''; I think the solution is to disambiguate '=>' differently, which seems to be what Perl itself does: $ my $x = 'foo'; $ $x =~ s=<foo== # OK $ $x =~ s=>foo== # NOT OK: Compile error: syntax error
From: hakim.cassimally [...] gmail.com
On Wed Jun 18 17:55:09 2014, Hakim wrote: Show quoted text
> I think the solution is to disambiguate '=>' differently, which seems > to be what Perl itself does: > > $ my $x = 'foo'; > $ $x =~ s=<foo== # OK > $ $x =~ s=>foo== # NOT OK: Compile error: syntax error
Have done this in T::B and issues Pull Request against gitpan repo https://github.com/gitpan/Text-Balanced/pull/4 please let me know if you'd prefer a patch in some other medium!
On Wed Jun 18 18:21:42 2014, Hakim wrote: Show quoted text
> Have done this in T::B and issues Pull Request against gitpan repo > https://github.com/gitpan/Text-Balanced/pull/4 please let me know if
Looks like that PR got deleted. Have rebased and reworked against SHAY's new repo and issued new PR at https://github.com/steve-m-hay/Text-Balanced/pull/1