Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Yahoo Hosting

by tbone654 (Sexton)
on Sep 19, 2013 at 20:25 UTC ( #1054908=perlquestion: print w/ replies, xml ) Need Help??
tbone654 has asked for the wisdom of the Perl Monks concerning the following question:

My website is hosted by yahoo... So in order to use perl modules not available on the yahoo server I create a subdirectory at my mount point on the yahoo server called /lib... I put a use statement near the top of the program... I manually upload all the .pm files in the proper sub-directories (i assume) and everything seems to run correctly to this point. So I can run my script from anywhere, even my cellphone browser.
use lib '../lib';

It works well for the most part... I added some code that pipes the error logs to the browser...
BEGIN { $| = 1; open (STDERR, ">&STDOUT"); print qq~Content-type: text/html\n\n~; }

The problem is I get an error that I'm not sure how to handle... First four are no problem, but the fifth one indicates it "Can't locate object method "new"" which does exist or it would error out before getting here. I use the CPAN module, and have re-copied it a number of times...
Use of uninitialized value in sprintf at /usr/lib/perl5/site_perl/5.8. +7/HTTP/Request/Common.pm line 18. Use of uninitialized value in sprintf at /usr/lib/perl5/site_perl/5.8. +7/HTTP/Request/Common.pm line 18. Use of uninitialized value in sprintf at /usr/lib/perl5/site_perl/5.8. +7/HTTP/Headers/Util.pm line 6. Use of uninitialized value in sprintf at /usr/lib/perl5/site_perl/5.8. +7/HTTP/Headers/Util.pm line 6. Can't locate object method "new" via package "HTML::TreeBuilder::XPath +" at ../lib/Web/Scraper.pm line 115. Return Code: 512
If I run it off my own server everything is fine... But from Yahoo it blows up here... Any thoughts? Hints?
# need to modify directly the HTML::Element package, because HTML::Tre +eBuilder won't let me # change the class of the nodes it generates package HTML::Element; use Scalar::Util qw(weaken); use vars qw(@ISA); push @ISA, 'HTML::TreeBuilder::XPath::Node'; use XML::XPathEngine; { my $xp; sub xp { $xp ||=XML::XPathEngine->new(); return $xp; } }
Does this mean I need more modules? possibly?

Comment on Yahoo Hosting
Select or Download Code
Re: Yahoo Hosting
by Anonymous Monk on Sep 20, 2013 at 00:44 UTC

    But from Yahoo it blows up here... Any thoughts? Hints?

    Don't turn on global warnings, no other thoughts

    Does this mean I need more modules? possibly?

    HA!

      Because it seemed to work except for version... I went back and deleted the version reference from the USE module statement in the module itself. Then it worked...

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1054908]
Approved by Old_Gray_Bear
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (17)
As of 2014-07-29 13:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (217 votes), past polls