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?
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.