Home > Archive > PERL CGI Beginners > October 2005 > Finding CGI.pm
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
| Rick Bale News 2005-10-10, 9:55 pm |
| Does anyone know where to get cgi.pm and do I just put it in my cgi-bin
folder?
| |
| Paul Lalli 2005-10-10, 9:55 pm |
| Rick Bale News wrote:
> Does anyone know where to get cgi.pm and do I just put it in my cgi-bin
> folder?
CGI.pm (not cgi.pm - case matters) is included in the standard
distribution of Perl. You should have it if you have Perl installed.
What happens when you execute this statement at the command line?
perl -MCGI -e1
If, for some very odd reason, you do not have CGI.pm, you can download
it from CPAN, and let CPAN.pm install it for you. It should *not* be
copied to your cgi-bin directory for any reason. Perl won't find it
there.
perl -MCPAN -e'install CGI'
Paul Lalli
| |
|
| Thank you for that explanation. Now I understand that it is should be with
the Perl installation. I do have Perl installed on my local server and I
did see the CGI.pm is in the server setup folders which is on my perl path.
My problem is out on the server provided by my site host. I can't seem to
get cgi working and they take for ever to respond to emails. I get a:
"Premature end of script headers: /home/.../public_html/cgi-bin/hello.cgi"
error every time I invoke this cgi file. The opening path is
#!/usr/bin/perl just like they tell me and the permission on this file is
755. It was working bu now it's not again.
"Paul Lalli" <mritty@gmail.com> wrote in message
news:1128994918.720501.92750@z14g2000cwz.googlegroups.com...
> Rick Bale News wrote:
>
> CGI.pm (not cgi.pm - case matters) is included in the standard
> distribution of Perl. You should have it if you have Perl installed.
> What happens when you execute this statement at the command line?
>
> perl -MCGI -e1
>
> If, for some very odd reason, you do not have CGI.pm, you can download
> it from CPAN, and let CPAN.pm install it for you. It should *not* be
> copied to your cgi-bin directory for any reason. Perl won't find it
> there.
>
> perl -MCPAN -e'install CGI'
>
> Paul Lalli
>
| |
| Paul Lalli 2005-10-11, 9:55 pm |
| Rick wrote:
> Thank you for that explanation. Now I understand that it is should be with
> the Perl installation. I do have Perl installed on my local server and I
> did see the CGI.pm is in the server setup folders which is on my perl path.
>
> My problem is out on the server provided by my site host. I can't seem to
> get cgi working and they take for ever to respond to emails. I get a:
>
> "Premature end of script headers: /home/.../public_html/cgi-bin/hello.cgi"
> error every time I invoke this cgi file. The opening path is
> #!/usr/bin/perl just like they tell me and the permission on this file is
> 755. It was working bu now it's not again.
That generally means your script did not print the standard HTTP
headers, or perhaps that your script died before it was able to print
the headers.
Assuming you're (wisely) using CGI.pm, do you have either
use CGI qw/:standard/;
print header();
or
use CGI;
my $q = new CGI;
print $q->header();
or lines like them, somewhere near the top of your code?
Perhaps you could post a short but complete script that exhibits this
problem?
Paul Lalli
|
|
|
|
|