in reply to Opening a file error
1) In this line:
Try this:if (!(open (OUT, ">$_"))) { print "Error opening file $_ for writing."; exit 0; }
The more tradional way to write this is:if(!open(OUT, ">$_")){ print "Error opening file $_ for writing: $!"; # $! holds the error mesg exit 0; }
Since you are using this in a CGI program, it'd be a good idea to use perlfunc:warn or perlfunc:die too. (See the module CGI::Carp for http friendly die and warn functions)open(OUT, ">$_") or die "Can't open $_ for writing: $!";
But it doesn't seem to get to this point, so this isn't the source of the troubles. 2) some more information would be useful. You have the line:
Does it get printed? (Note that print statements might occur but not get printed if they are in the buffer when the program gets confused. Either use warn statements, or set $|=1, which will autoflush any statements in the buffer).print ">$_";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: Re: Opening a file error
by KM (Priest) on Jun 09, 2000 at 18:27 UTC | |
|
RE: Re: Opening a file error
by Anonymous Monk on Jun 09, 2000 at 22:52 UTC |