CVf_METHOD CVf_LOCKED CVf_LVALUE CVf_ASSERTION
PMf_KEEP PMf_GLOBAL PMf_CONTINUE PMf_EVAL PMf_ONCE PMf_SKIPWHITE
PMf_MULTILINE PMf_SINGLELINE PMf_FOLD PMf_EXTENDED);
-$VERSION = 0.71;
+$VERSION = 0.72;
use strict;
use vars qw/$AUTOLOAD/;
use warnings ();
sub balanced_delim {
my($str) = @_;
my @str = split //, $str;
- my($ar, $open, $close, $fail, $c, $cnt);
+ my($ar, $open, $close, $fail, $c, $cnt, $last_bs);
for $ar (['[',']'], ['(',')'], ['<','>'], ['{','}']) {
($open, $close) = @$ar;
- $fail = 0; $cnt = 0;
+ $fail = 0; $cnt = 0; $last_bs = 0;
for $c (@str) {
if ($c eq $open) {
+ $fail = 1 if $last_bs;
$cnt++;
} elsif ($c eq $close) {
+ $fail = 1 if $last_bs;
$cnt--;
if ($cnt < 0) {
# qq()() isn't ")("
last;
}
}
+ $last_bs = $c eq '\\';
}
$fail = 1 if $cnt != 0;
return ($open, "$open$str$close") if not $fail;