ATLien has asked for the wisdom of the Perl Monks concerning the following question:
I'm attempting to process multiple files - using a text based file list - using XML::XPath module. Processing one file works as advertised - but attempting to process multiple files, I get a "Cannot open file..." error on the first file in the list. Here is the code I'm using:
and the file list is a simple text file like:foreach $page (@files) { my $xp = XML::XPath->new(filename => $page); my $nodeset = $xp->find('//DCR'); # find all DCRs my @nodelist = $nodeset->get_nodelist; @dcrs = map {$_->string_value ? $_->string_value : ()} @nodeli +st; foreach my $dcr(@dcrs) { print "$dcr\n"; } }
|
|---|