You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Karyn Ulriksen <ku...@publichost.com> on 2000/03/03 01:38:10 UTC

cgi script translated to mod_perl errors

I rewrote a counter module that was originally written as a standard cgi
script.

I mucked out all the PerlMagick errors as a standard cgi.  One of the errors
it dumped as a CGI was:
  "Can't use string ("Warning 310: Unable to append im") as an ARRAY ref
while "strict refs" in use" which was occurring because it errored on trying
to open the counterfile (due to inappropriate permissions).  Once the web
server was allowed to write to the counterfile, it no longer generated this
message and was happy.

Now in the module, all the permissions for the files are appropriate.  I
determined the file that it is writing to is 
the correct one and is actually updating.  I eliminate the calls to the
function that uses the PerlMagick code and it no longer generates the error,
so obviously it is within that subroutine - even though under the standard
CGI it didn't have the problem.  The error code is just as above.  So I
think the problem now lies in where it is trying to write out to which is
suppose to be STDOUT.  In PerlMagick, the instruction to write to STDOUT
looks like this:

	 $counter->Write('gif:-');

	The "-" indicates that is to be written to STDOUT. Otherwise, you
provide a filename.  I thought I read somewhere along the lines that you
have to specifically tell a module to print to STDOUT, ( for example:  print
STDOUT "stuff"; ).  I suspect that, it's trying to write a file called "-"
somewhere that it's not allowed to.  Will using "select" to select STDOUT
get me past this problem?

	- Karyn Ulriksen