Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hello All I am having a lil issue, I just installed mod_perl and have been testing my scripts to see if they are still functioning like they should. My scripts are working super fast now but image::size is not working any longer and it seems to be installed and working with non mod_perl. Any help would be appreciated. Thanks!

Replies are listed 'Best First'.
Re: mod_perl and image::size
by jbrugger (Parson) on Mar 15, 2005 at 08:59 UTC
    Could you at least post some code snipplets? Image::Size should work fine using mod_perl, probably you haven't defined or cleared some variable that mod_perl keeps in memory.
    Try using strict and turn on warnings to get some more information about your script.
Re: mod_perl and image::size
by perrin (Chancellor) on Mar 15, 2005 at 06:33 UTC
    Are there any error messages? Anything in the log file? Have you tried to figure out where your scripts are failing?
      no error messages nothing in log file image::size keeps reporting 0,0 for height width where when im not using mod_perl it reports correctly
Re: mod_perl and image::size
by duct_tape (Hermit) on Mar 15, 2005 at 17:02 UTC

    Perhaps it is a file permissions issue. Make sure that the file is readable by the web server.

    Another thing that could be happening is that you are using a relative path to specify the file location, and the script running under mod_perl might not be running from with the same current directory as the old script was. Try using chdir() or specifying the full path to the file to see if that helps.

    The imgsize function returns 3 things when an error occurs. The results are (undef, undef, "ERRORMESSAGE"). Check that error message to see if/what error is occuring.

    my($w, $h, $err) = imgsize($file); die $err if ($err);

    These are the only things I can think of off the top of my head. It will be easier for people to help you if you post some code.

    Brad