in reply to not in my browser (truncated output)

I usually turn off buffering right after my use CGI; statement:
use CGI; $| = 1; ...
This will turn off output buffering, which sometimes causes the output of CGI scripts to be incomplete on FreeBSD boxes, especially when running outside processes; at least, that was my experience.

If lynx is timing out, as fglock mentioned, you could also take a look at LWP::UserAgent, here's a snippet:

use LWP::UserAgent; $ua = new LWP::UserAgent; # Create a request my $req = new HTTP::Request GET => "http://www.craigslist.org/sfo/$cat +egories[$i]"; # 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"; }
Turning off buffering will also allow you to see your script errors in the browser. I find this handy when I need to write a short script, such as you have here, and I need to see the output in the browser whether it completes or not.

--
.dave.

Replies are listed 'Best First'.
Re: Re: not in my browser (truncated output)
by mkahn (Beadle) on Jul 11, 2002 at 20:31 UTC
    Thanks dave. Your code faithfully returns "bad luck this time". I tried LWP::UserAgent, as above, as well as LWP::Simple get and getprint, and all the external calls fail. These module based solutions fail from the prompt as well as the browser. IS pair just not letting me open an external file?
Re: Re: not in my browser (truncated output)
by mkahn (Beadle) on Jul 12, 2002 at 21:02 UTC
    The answer was: provide the path to /usr/local/bin/lynx