Problème avec la librairie XML::Bare
Bonjour à tous,
j'ai un problème avec la librairie XML::Bare de Perl (dans sa dernière version).
Code:
1 2 3 4 5 6 7 8 9 10
|
my $xml_file = new XML::Bare( file => "ref/ref.xml" ) or die "Impossible
d'ouvrir le fichier ref/ref.xml";
my $root = $xml_file->parse();
$xml_file->find_by_perl($root->{ISMP}->{Product}, "-ProductName =~
/ftp/i");
return $error;
} |
Mais j'ai cette erreur :
Citation:
Not a array reference at /.../.../.../Bare.pm line 410.
Un extrait de Bare.pm :
Code:
1 2 3 4 5 6 7 8
| 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;
} |
La ligne 410 correspond à celle du foreach.
Je ne comprend pas pourquoi j'ai cette erreur. La fonction find_by_perl est définie dans la doc :
http://search.cpan.org/~codechild/XM...dule_Functions
Merci.