Perl Pains
Ok so I'm totally noob at Perl, so I'd be very grateful if the guru l33t haX0rs can help me out here.
Was pointed out to the existence of Amazon Web Services today, which is really quite cool, cos it gives you access to the Amazon technology platform.
Ok so I thought, no problem, should be able to hammer out a simple program to test this out. So what's the best way to get started? Sample code of course. Problem being that it seemed like Perl was the easier way to get things going compared to Java, but I don't know any Perl. But no big deal, I shouldn't have that much difficulty picking it up right? After all, you know, CS major right?
Wrong - I couldn't even get the Perl interpreter to run the simple Perl pricing tool sample.
What I got at first was:
C:\Perl>perl pricing_tool.pl 1875124
Can't locate XML/XPath.pm in @INC (@INC contains: C:/Perl/lib C:/Perl/site/lib .) at pricing_tool.pl line 7.
BEGIN failed--compilation aborted at pricing_tool.pl line 7.
Ok, so there's a problem with line 7: use XML::XPath;
Weirdly in my activeperl installation, the /XML directory doesn't have an XPath subdirectory!
So I check out CPAN and find this, which seems like the right thing.
Trying again, after replacing the /XML directory with the new one, i get
C:\Perl>perl pricing_tool.pl 1875124
Can't locate XML/Parser.pm in @INC (@INC contains: C:/Perl/lib C:/Perl/site/lib.) at C:/Perl/site/lib/XML/XPath/XMLParser.pm line 7.
BEGIN failed--compilation aborted at C:/Perl/site/lib/XML/XPath/XMLParser.pm line 7.
Compilation failed in require at C:/Perl/site/lib/XML/XPath.pm line 13.
BEGIN failed--compilation aborted at C:/Perl/site/lib/XML/XPath.pm line 13.
Compilation failed in require at pricing_tool.pl line 7.
BEGIN failed--compilation aborted at pricing_tool.pl line 7.
Apparently there's a problem locating XML/Parser.pm. Obviously so, since it appears that Parser.pm exists only in the directory XML/XPath.
Ok so I give it a hand, changing line 7 from
use XML::Parser;
to
use XML::Xpath::Parser;
And now I get
C:\Perl>perl pricing_tool.pl 1875124
Bareword "XML::XPath::Step::test_nt_node" not allowed while "strict subs" in use at C:/Perl/site/lib/XML/XPath/Parser.pm line 423.
Compilation failed in require at C:/Perl/site/lib/XML/XPath/Step.pm line 4.
BEGIN failed--compilation aborted at C:/Perl/site/lib/XML/XPath/Step.pm line 4.
Compilation failed in require at C:/Perl/site/lib/XML/Xpath/Parser.pm line 19.
BEGIN failed--compilation aborted at C:/Perl/site/lib/XML/Xpath/Parser.pm line 19.
Compilation failed in require at C:/Perl/site/lib/XML/XPath/XMLParser.pm line 7.
BEGIN failed--compilation aborted at C:/Perl/site/lib/XML/XPath/XMLParser.pm line 7.
Compilation failed in require at C:/Perl/site/lib/XML/XPath.pm line 13.
BEGIN failed--compilation aborted at C:/Perl/site/lib/XML/XPath.pm line 13.
Compilation failed in require at pricing_tool.pl line 7.
BEGIN failed--compilation aborted at pricing_tool.pl line 7.
Ok so I guess I shouldn't be messing with library code here but what the heck is going on? Why is their code referring to invalid paths? Has anyone gotten the XML package to work before?

1 Comments:
Ok forget it, problem solved.
Apparently I needed this.
Even then the paths are all wrong. Just hacked them so that it works.
Am I missing something here?
Post a Comment
<< Home