Willem Pretorius wrote: > ok, now i have gotten the file to be executed from shell if i type : perl > myfile.pl , and it work perfectly, but now, if i try and execute the same > file from the web, i get the 'internal server error'.. what can be causing > this, why, and how do i fix it? >
you need to know how CGI works. the client(your browser) expects your script to return a certain thing in a certain order. the first thing that the browser expect is something call a header which tells the browser what document is coming up. the browser needs to know this to prepare for itself. other than HTML document, there are many more different doc out there that the browser might encounter, so it's important for the browser to know before hand what might come up. the header gives the browser an idea of what will come up. your script runs fine from the command line so i assume it wouldn't have any syntax error(warnings etc) which is a big cause for the 'internal server error' error. you are probably missing the header so your browser guess that there might be something wrong with the server so it tells you there is an internal server error. what is the first thing that your script prints? or does it print anything at all? a typical header(there are a lot more but you can start experiment with these 2 simple ones) looks like: Content-Type: text/html or: Content-Type: text/plain follow by 2 newlines. since your script is not indent for CGI, i would just suggest using the text/plain header and see what comes up. so try putting a line like: print "Content-Type: text/plain\n\n"; near the top of your script before you print anything else to see if the error goes away. there are many more reasons an 'internal server error' comes up such as the server do not have permission to execute your script or the server is badly configurated... etc. you also need to read what CGI is all about. you will have a lot to read. :-) david -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]