Skip Menu |

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

Report information
The Basics
Id: 78855
Status: new
Priority: 0/
Queue: Text-Balanced

Owner: Nobody in particular
Requestors: florent.angly [...]

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

Subject: Incorrect variable names returned by extract_variable()
MIME-Version: 1.0
X-Mailer: MIME-tools 5.427 (Entity 5.427)
X-RT-Original-Encoding: utf-8
Content-Type: multipart/mixed; boundary="----------=_1344484378-15669-2"
Content-Length: 0
Content-Type: text/plain; charset="UTF-8"
Content-Disposition: inline
Content-Transfer-Encoding: binary
Content-Length: 770
Download (untitled) / with headers
text/plain 770b
Hi, When using the extract_variable() function, some of the variable names returned by Text::Balanced are incorrect. The output of the attached script is: foo is (?^:^(km|mi)$) /^(km|mi)$/ foo contains variable names: $) $/ There are two issues: A) The first variable detected, $), is not a valid variable name in Perl. Maybe Text::Balanced could check against the Perl variable naming rules: B) The second variable, $/, is a Perl special variable (, which is fine. However, in the given context, at the end of a regular expression, the dollar sign does not indicate a variable but matches the end of string. Best, Florent
MIME-Version: 1.0
Content-Type: application/x-perl; name=""
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline; filename=""
Content-Transfer-Encoding: base64
Content-Length: 340
text/x-perl 340b
#! /usr/bin/env perl use strict; use warnings; use Text::Balanced qw(extract_multiple extract_variable); my $foo = qr/^(km|mi)$/ .' '. '/^(km|mi)$/'; print "foo is $foo\n"; print "foo contains variable names:\n"; for my $var_name (extract_multiple($foo,[sub{extract_variable($_[0],'')}],undef,1)) { print " $var_name\n"; } exit;

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to