Anish Kumar K. wrote: > File is not getting created in perl CGI mode... > > It is surprising that the file is not created in the CGI.... > > I tried this from the command line it is getting created there...
Most likely explanation is that the web server user does not have write privilege in the directory you're trying to create the file in, or the file already exists and the web server user doesn't have write privilege. Add $! to your error message to see more information. > > I am not able to debug also this issue. Please help in proceeding > this.... > > #!/usr/bin/perl > use CGI; use strict; use warnings; > my $cgi=new CGI; > print $cgi->header(); > print $cgi->start_html("Browser Information"); > > open (TXT, ">tmp.txt") || die "Can't create $file"; ($file is not defined) open (TXT, ">/some/absolute/path/tmp.txt") || die "Can't create file: $!"; You should always use an absolute path from a CGI script. Don't make assumptions about what the current directory is. Probably, it's the script directory, but you can't depend on that. > print TXT"This is test"; > close TXT; -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>