hey,
i have this simple code, but always gives me an error. I think it has to do something with the installation?
use XML::LibXML;
use Data::Dumper;
my $xml_feed = "C:/xml_learn/g_headlines.xml";
my $parser = XML::LibXML->new;
my $dom = $parser->parse_file($xml_feed) or die;
my @titles = $dom->getElementsByTagName("title");
foreach my $t (@titles) {
print $t->firstChild->data, "\n";
}
Now it always prints the error:
Can't load 'C:/Perl/site/lib/auto/XML/LibXML/Common/Common.dll' for mo
+dule XML::LibXML::Common: load_file:Access is denied at C:/Perl/lib/D
+ynaLoader.pm line 230.
at C:/Perl/site/lib/XML/LibXML.pm line 11
I installed XML::LibXML through the ActiveState PPM3 and it asked me if I wanted to install the libxml2.dll. I also searched for "common.dll" and its located in the correct directory as the one listed in the error
What am I doing wrong? Do i need to install another module or install something else to get this working?
thanks
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.