Re: 500 Internet error problems

Ryan Retting (rretting@calpoly.edu)
Wed, 28 Oct 1998 16:41:23 -0800


Thanks for all of your responses.  I did make a mistake in my *message* but
that is not the cause of the problem.  In a hurrry I forgot to type use
LWP::Simple instead of use LWP;
I have tried both LWP::Simple and the user agent with no success.  I can use
perl with no problem and get results on a browser until i try to use LWP in
any shape or form (it seems).  That's when I get a 500 error.  I think it
might be because I have LWP and everything else installed in my ~/perl
directory and all of that was installed 100% successfully inculding 100%
successful tests.

I CAN use the same exact program from the command line with "use LWP; or use
LWP::Simple;" in it, but  then when I try to use a browser I cannot, even
LYNX.

I've set permissions on the perl file to 755 (a+rx).  I've experimented with
the possibility of setting changing permissions of the ~/perl directory but
I think that's not necessary.

any suggestions would be appreciated.  I've been stuck on this one for a
LONG TIME!
    -Ryan
    -Ryan

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
ROCK - ICQ#9082094
rretting@calpoly.edu
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
-----Original Message-----
From: Roland Bauer <roland.bauer@fff.at>
To: Ryan Retting <rretting@calpoly.edu>; libwww-perl@ics.uci.edu
<libwww-perl@ics.uci.edu>
Date: Wednesday, October 28, 1998 2:23 AM
Subject: Re: 500 Internet error problems


>Hello Ryan,
>
>I think you first have to create a user agent like described in LWP.pm.
>(You can get this info with command "perldoc LWP".)
>
>The one example you give just seems :-) to work.
>
>THIS WORKS: (no 500, though blank)
>#!/usr/local/bin/perl
>print "Content-type: text/html\n\n";
>#use LWP;
>$url = "http://www.perl.com";
>$in = get($url);
>print $in;
>
>Because it's like:
>
>#!/usr/local/bin/perl
>print "Content-type: text/html\n\n";
>print ""; # or maybe print undef
>
>Roland
>
>
>(Please see snippet below.)
>
>#----------
>=head2 An Example
>
>This example shows how the user agent, a request and a response are
>represented in actual perl code:
>
>  # Create a user agent object
>  use LWP::UserAgent;
>  $ua = new LWP::UserAgent;
>  $ua->agent("AgentName/0.1 " . $ua->agent);
>
>  # Create a request
>  my $req = new HTTP::Request POST =>
>'http://www.perl.com/cgi-bin/BugGlimpse';
>  $req->content_type('application/x-www-form-urlencoded');
>  $req->content('match=www&errors=0');
>
>  # Pass request to the user agent and get a response back
>  my $res = $ua->request($req);
>
>  # Check the outcome of the response
>  if ($res->is_success) {
>      print $res->content;
>  } else {
>      print "Bad luck this time\n";
>  }
>
>The $ua is created once when the application starts up.  New request
>objects are normally created for each request sent.
>#------------
>
>Ryan Retting wrote:
>
>> I'm getting 500 Internet error problems.
>> It will run on the command line and not through MSIE or LYNX and yes
there
>> is a print "Content-type: text/html\n\n"; line.
>>
>> Through hours and hours of trying to get it to work, i've concluded that
>> whenever i try any form of use LWP; I'll get a 500 error.
>>
>> A possibly related thing is that LWP, Data-Dumper, HTML-Parser, MD5,
>> MIME-64, etc. are all installed (and reinstalled many times 100%
>> successfully through all tests) in ~/perl.  I used the perl Makefile.PL
>> PREFIX=~/perl LIB=~/perl
>> command when installing these.
>>
>> I also have PERL5LIB=~/perl in my env.
>>
>> THIS DOES NOT WORK:
>> #!/usr/local/bin/perl
>> print "Content-type: text/html\n\n";
>> use LWP;
>> $url = "http://www.perl.com";
>> $in = get($url);
>> print $in;
>>
>> THIS WORKS: (no 500, though blank)
>> #!/usr/local/bin/perl
>> print "Content-type: text/html\n\n";
>> #use LWP;
>> $url = "http://www.perl.com";
>> $in = get($url);
>> print $in;
>>
>> THIS DOES NOT WORK:
>> #!/usr/local/bin/perl
>> print "Content-type: text/html\n\n";
>> use LWP ;
>> print "hello";
>>
>> THIS DOES WORK:
>> #!/usr/local/bin/perl
>> print "Content-type: text/html\n\n";
>> print "Hello";
>>
>> THIS DOES NOT WORK (~/perl = /home/cscstd/qurst/rretting/perl):
>> #!/usr/local/bin/perl
>> print "Content-type: text/html\n\n";
>> use LWP "/home/cscstd/qrst/rretting/perl";
>> $url = "http://www.perl.com";
>> $in = get($url);
>> print $in;
>>
>> THIS DOES NOT WORK:
>> #!/usr/local/bin/perl
>> print "Content-type: text/html\n\n";
>> use lib "home/cscstd/qrst/rretting/perl";
>> use LWP;
>> $url = "http://www.perl.com";
>> $in = get($url);
>> print $in;
>>
>> hopefully those examples helped.
>> thanks!
>>       -Ryan
>>
>> \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
>> ROCK - ICQ#9082094
>> rretting@calpoly.edu
>> \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
>
>
>
>--
>roland.bauer@fff.at        +43-(1)-33-421-88  (home)
>http://www.fff.at/fff/     +43-(1)-536-06/537 (work)
>
>
>