use strict; use XML::LibXML; my $parser = XML::LibXML->new; my $doc; my $RAW_FILE = 'sample.xml'; eval { $doc = $parser->parse_file($RAW_FILE); };