$currdir=cwd(); $opffile="${unencdir}\\${t}"; # passed into the sub $parser=XML::XPath::XMLParser->new(filename => ${opffile} ); eval { $doc = $parser->parse } ; if ( (! defined $doc) || $@) { print stderr "Parse of ${opffile} failed $@\n"; print stderr "Can't obtain needed information from opf...aborting\n"; exit 17; }