Subject: | find_by_perl doesn't work |
Hi,
find_by_perl method doesn't work.
From documentation:
---
$object->find_by_perl( $root->{xml}->{ob}, "-key eq '1'"
)->[0]->{val}->{value} = 'test';
---
From source:
---
sub find_by_perl {
my $arr = shift;
my $cond = shift;
$cond =~ s/-([a-z]+)/\$ob->\{'$1'\}->\{'value'\}/g;
my @res;
foreach my $ob ( @$arr ) { push( @res, $ob ) if( eval( $cond ) ); }
return \@res;
}
---
Issues:
1) $self argument is missed;
2) [a-z]+ regexp doesn't match uppercase letters.