On 3 Feb 2005, at 06:24, Elliot Holden wrote:

okay this may seem like a simple problem but here it goes:
when running the the script below from the unix (mac osx) command line the "survey.txt" file is created and "this a test!!!" is written to the file. But when running it from a browser the file is Not created and "Browser test" is displayed in the browser. So in essennce when running from a browser the file creation section of the script is being skipped over. Please, please, please, why is this happening, somebody? I've tried it on diffferent browsers - Mozilla, IE.



open(OUTFILE, ">>survey.txt"); print OUTFILE "this is a test!!!\n"; close(OUTFILE); print "<html>Browser test</html>\n";


Maybe I'm being too simplistic here, but where exactly are you looking for the file to be created?

When run from the command line the file will get created in that directory (folder), but when you use the browser it will depend on what the web server thinks is the current directory (probably the document root) as it is the server that creates the file, not the browser. However, I am assuming you are running the script as a CGI - you've not made entirely clear just how you are using the browser to run the script.



Ken  G i l l e t t

_/_/_/_/_/_/_/_/_/


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to