For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > September 2007 > Re: running cgi off the command line works, but running on the browser fails with a 5









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]

 

Author Re: running cgi off the command line works, but running on the browser fails with a 5
Tom Phoenix

2007-09-27, 7:01 pm

On 9/27/07, Pat Rice <patrick.j.rice@gmail.com> wrote:

> Line 25 -- shown below, is just a simple getstore, this works when run from
> the command line, but when run form the webserver, I get above error
> message, I've tried the usual 500 error messages, just wondering if anyone
> has any ideas ???


A "500 error message" is pretty nearly useless; what you want is the
dying words from your program, which are probably in your server's
error log.

But I'd guess from the nature of your problem that you might have a
different version of Perl on the webserver than you used for testing
on the command line. Or, you didn't use the -w switch when you tested
your program on the command line.

> 1 #!/usr/bin/perl -w
> 2 use CGI qw(:standard);
> 3 use CGI::Carp qw(warningsToBrowser fatalsToBrowser);
> 4 use strict;
> 5 #### adding the bits from teat.pl
> 6 use warnings;
> 7 use LWP::Simple;


I suspect that LWP::Simple is trying to import a subroutine named
head(), but you already got one from the CGI module. If that's the
case, you can tell either one of the modules that you don't want it to
import head(), and that should solve your problem.

Cheers!

--Tom Phoenix
Stonehenge Perl Training
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com