Subject: | Bug when extracting 4 delimited fields |
I have observed a weird behaviour when extracting strings (with
extract_multiple and extract_delimited) that is supposed to contain 4
fields: only 3 are returned.
The same test with 3 or 5 fields produces the expected results though.
A test script is attached.
Florent
Subject: | balanced_test.pl |
#! /usr/bin/env perl
use strict;
use warnings;
use Data::Dumper;
use Text::Balanced qw(extract_multiple extract_delimited);
my $value;
my @arr;
$value = "1 1 1";
print "value: '$value'\n";
@arr = extract_multiple( $value, [sub { extract_delimited($_[0],q{ '"}) },] );
print Dumper(\@arr)."\n";
$value = "1 1 1 1";
print "value: '$value'\n";
@arr = extract_multiple( $value, [sub { extract_delimited($_[0],q{ '"}) },] );
print Dumper(\@arr)."\n";
$value = "1 1 1 1 1";
print "value: '$value'\n";
@arr = extract_multiple( $value, [sub { extract_delimited($_[0],q{ '"}) },] );
print Dumper(\@arr)."\n";
exit;