in reply to Re^2: WGET equivalent
in thread WGET equivalent

The current directory is not what you think. Especially, it's not the directory your script file is in.

For error messages, look in your webserver error log.

Replies are listed 'Best First'.
Re^4: WGET equivalent
by downer (Monk) on Feb 01, 2008 at 22:42 UTC
    ok, I seem to have addressed this, LWP::user agent's is_success returns "permission denied" I am not writing anything here, just using a module. Do I need to figure out how to change permission so I can use modules?

      Sorry, but without any code or anything that you show us, it's near impossible to diagnose (or even fix) the error you're getting.

      Maybe the permission denied comes from a malformed URL you're requesting? Reduce your script to the minimum code that still fails, and post that.

        here is an example of my script with most of the details eliminated, still producing a  permission denied error. Most mysterious!
        #!/usr/local/bin/perl -w use strict; use CGI qw(:standard); use CGI::Carp qw(warningsToBrowser fatalsToBrowser carpout); use lib qw(/usr/lib/perl5/vendor_perl/5.8.6/LWP /usr/lib/perl5/vendor_ +perl/5.8.6 / /usr/lib/perl5/vendor_perl/5.8.6/LWP/UserAgent.pm); use LWP::UserAgent; my $ua = LWP::UserAgent->new; $ua->timeout(10); $ua->agent('Mozilla/5.0'); my $current_page = "http://www.perlmonks.org"; my $response = $ua->get($current_page); my $data = $response->content if($response->is_success) or die "not su +ccessful $!\n"; if($data){ print "page: $current_page\n$data\ndone", length($data); } else { print "no data\n"; }