Following code 29 data is nodeValue alias specific to XML LibXML Text

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
Following code:
29 # ->data is ->nodeValue alias specific to XML::LibXML::Text nodes
30 my @files = grep({
31 my ($volume, $fpath, $fname) = File::Spec->splitpath($_->data);
32 $fname eq $needle_fname;
33 }, $dom->findnodes($xpath));
34
35 if (length(@files) != 1) {
36 die "There should be one and only one file named <$needle_fname> under <$xpath> in <$haystack_fname>";
37 }
Produces error:
$ perl -c module.pm
syntax error at module.pm line 33, near "},"
module.pm had compilation errors.