|
|
 |
|
|
Pages: 1
How do I include cgi.pm???
(Click here to view the original thread with full colors/images)
Posted by: TheHaunt
ok, so I finally managed to get basic cgi scripts running on the server I have to work with. Now I have a new problem. I spent a great deal of time writing a lovely script to process forms and output a new html page. It used the cgi.pm module which came with the version of perl I downloaded for local testing purposes. The problem is, the server is running perl 5.001 (since they gave no letter designation, I assume it's the first version of 5.001)
What I need to know is, how can I include cgi.pm in the script so it will function correctly. I opened the cgi.pm I downloaded and it tells me to do this:
BEGIN {
unshift(@INC,'/home/davis/lib');
}
use CGI;
So I added that to my script changing
/home/davis/lib
to
twp.brm/www/cgi
which is where I put cgi.pm
now when I log into the server I start at folder
twp.brm
so I assumed I entered the path above correctly, but it doesn't seem to work. I'm about ready spit fire. After days of aggrivation at not being able to get any scripts working, when I finally figured out what I was doing wrong (Needed to omit the path to perl), I was sure that everything was falling into place and then this happens. So what can I do to include cgi.pm short of demanding that the server upgrade perl, which I'm fairly sure they're not willing to do for little old me.
Posted by: TheHaunt
I don't know if it matters, but I think the server is windows based
Posted by: bean
First off, if your hosting company is running perl 5.001, they're horribly, horribly outdated and need to upgrade, or you need to find a new hosting company. There are so many modules and commands that won't work in perl 5.001 it's unbelievable to me that a professional hosting company hasn't upgraded since then.
That said, if you're developing perl, you'll want access to the error logs. 9 times out of 10, any problem you're having with perl you can solve on your own just by looking at the errors. If they won't let you have access to them, that's just one more reason to host somewhere else.
Ok, now to the meat of your problem. The include path is going to be looking for either a full path (starting from "/" ) or the path relative to the script that you're trying to call. So if your script is in "twp.brm/www", you'll want to include "./cgi".
If you know the full path, you might want to try going that route, as it's more portable, since it'll work even if you move your script.
Posted by: TheHaunt
For the sake of simplicity, I have placed the cgi.pm in the same dir as the scripts. I tried the above to no avail. If the script and the module reside in the same dir, what would the *** be in the following
BEGIN { unshift(@INC, '***') }
|
|
|
|
|