Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Strange problem with perl CGI

Status
Not open for further replies.
Apr 16, 2001
29
US
Ok, this may be an apache problem, rather than a cgi problem, but I'd figured I'd ask here first since nothing I've read anywhere has given me any assistance.

I am working on a cgi script on a linux box. It is using two perl modules that I created. Everything was working fine (I could use the modules, everything ran, etc)

Then I added in some new routines to the modules, reinstalled it, tested everything at the command-line (which worked fine), and tried it out with a cgi program. Nothing. The error log claims that the routines were not found in the module. But, it is installed correctly and works unless I'm going through CGI.

Any ideas?
 
Try using:

use CGI::Carp qw(fatalsToBrowser);

it might give you a better explanation. One thing to check is whether you have saved the modules in the correct place. The fact that you have tested this on the command line and it works, leads me to think you have, but just in case. Also are you using the Exporter? If so you'll need to add the routines into the EXPORT list.

Barbie
Leader of Birmingham Perl Mongers
 
Thanks, I'll try using that Carp routine. Maybe it'll give me an idea.


As for the other suggestions, I checked and they ARE in the right place, and I am exporting the routines. Very confusing.

Oh, and what is even more confusing, the old routines still work fine, so the module IS being used, I just can't use the new routines I wrote.

Should I try posting this problem in the CGI or Apache forums? The more I work with this the less I think that it is a perl problem...
 
Paths...?

What webserver, what directories, what permissions

--Paul

It's important in life to always strike a happy medium, so if you see someone with a crystal ball, and a smile on their face ...
 
Are the file permissions set correctly? This is probably the single largest error users make when installing new/modifed files.

There's always a better way...
 
Yes the permissions are correct. The wierd thing about this is that the old routines still work. I have CGI programs that use them and they still work fine. It's JUST the new routines that I added into that module that are not working. I also checked, and there is only one copy of that module installed, so it's not like there is a version lying around that doesn't have the new routines.
 
Is the filename correct?

There may be a subtle upper /lower case issue which is why one version still works, and another doesn't.

To test, rename the known module to .meph as opposed to .pl, or .cgi. If the old functions still work, we're probably looking at a potential exorcism ;)

HTH
--Paul

It's important in life to always strike a happy medium, so if you see someone with a crystal ball, and a smile on their face ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top