in reply to getting HTML source

And, as always, make sure that you give a complete path to your system commands (e.g. lynx) so the CGI script knows where it is. I recommend putting them all at the top of your script for easy maintenance:

#!/bin/perl -- major peices missing, but you get the picture use CGI; my $lynx = "/usr/bin/foo/bar/lynx"; my $wget = "/export/home/genghis/bin/wget"; ##etc..

Same goes for that ourput file in your example (file.txt) - make sure you are giving an absolute path, as you cannot be sure from what directory lynx is being invoked.

Heck, as a general rule of thumb, use absolute paths for everything - it will save a lot of trouble in the long run. :)

Replies are listed 'Best First'.
Re (Turnstep):Re: getting HTML source
by coreolyn (Parson) on Jan 05, 2001 at 00:23 UTC

    Well I'm amazed I'm actually saying this about a turnstep post, but any advice that is pro hardcoded 'absolute file paths' I've got to add some advice. For code reuse and maintenance I've developed the general of rule of storing all absolute paths in an external file (.cnf .que, etc.)an grabbing them from there. Making one change in an external file is much more economical and portable.