in reply to writing to a file in a cgi script
You can check this using the Cwd module.
#!/usr/bin/perl use strict; use CGI; my $q = new CGI; use Cwd; $dir = cwd; print $q->header('text/plain'), $dir; exit(0);
My bet is that the current working directory isn't what you think it is when run as a CGI script.
Alternatively, use an absolute path rather than a relative one, ie:
open OUT, ">/path/to/bg.cnt" or die "can't open bg.cnt for writing";
.02
cLive ;-)
ps - and including $! in the die statment will help - if you put:
at the beginning of your script.use CGI::Carp 'fatalsToBrowser'
|
|---|