running cgi off the command line works, but running on the browser fails with a 500 error



Hi all
Error 500 error is the follwoing

[Thu Sep 27 16:26:56 2007] [error] [client 10.16.153.99] Prototype mismatch:
sub main::head: none vs ($) at /var/www/cgi-bin/srHandler4.cgi line 7
[Thu Sep 27 16:26:57 2007] [error] [client 10.16.153.99] [Thu Sep 27
16:26:57 2007] srHandler4.cgi: Error 500 on
http://pseweb.vmware.com/pending/194951021
a
t /var/www/cgi-bin/srHandler4.cgi line 25.


The problem is with line 7 and 25


line 7 -- shown below is prety simple
5 #### adding the bits from teat.pl
6 use warnings;
7 use LWP::Simple;


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 ???

21 my $url = "http://private.private.com/pending/$variable_name";;
22 #print "\n This is the web site that I'm trying to got to : $url";
23 my $file = 'testPseweb2.html';
24 my $status = getstore($url, $file);
25 die "Error $status on $url" unless is_success($status);
26
I've been stuck on this for a while and I'm starting to wonder..... I'm
attaching script below

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;
8
9 ###### setting up the variables for the form
10 my $query;
11 my $p;

# chaged this for trouble shooting
12 #my $variable_name = param("srNumber");
13 my $variable_name = 194951021;
14
15
16
17 ####### adding teat.pl
18 #here I take the number form the form and try to pull down page
19 # This fails with 500 error, but testing it through a browser it
works,
20 # Hence the resion for the print statment
21 my $url = "http://test.test.com/pending/$variable_name";;
22 #print "\n This is the web site that I'm trying to got to : $url";
23 my $file = 'testPseweb2.html';
24 my $status = getstore($url, $file);
25 die "Error $status on $url" unless is_success($status);
26
27
28
29
30
31 ####### this part parses the file pulled down from lwp, and pick out
what I want
32 my $img;
33 my $src;
34 my $alt;
35 my $a;
36 my $href;
37 my $href2;
38 my $msup;
39 my $msupdir;
40 my $substrMsup;
41
42
43 open(IN, "<$file") || die "Can't open $file: $!";
44 while (<IN>) {
45 my @array_of_data = <IN>;
46
47 foreach my $line (@array_of_data)
48 {
49
50 chomp($line);
51
52 if ($line =~ /vm-support/i)
53 {
54
55 ################Now do something in this if statment
56 ############ Split The file, and pick out the
correct word for time and date.
57 ##I'm picking out what I want out of the web page
here
58 ($img, $src, $alt, $a, $href) = split (' ', $line);
59 ($href2, $msup, $msupdir) = split ('"', $href);
60 ($substrMsup) = split ('/', $msup);
61 }
62 }
63 }
64 close(IN);
65
66 print header;
67 print start_html("Thank You");
68 print h2("Thank You");
69
70 #print "variable name: $variable_name";
71 #print "vm-support: $substrMsup";
72 print end_html;
73
74
75
76


Relevant Pages

  • Re: running cgi off the command line works, but running on the browser fails with a 500 error
    ... Error 500 error is the follwoing ... line 7 -- shown below is prety simple ... message, I've tried the usual 500 error messages, just wondering if anyone ... Paul Lalli ...
    (perl.beginners)
  • Re: Is this legal Fortran 77?
    ... >You must have turned on the option to treat warnings as errors. ... I do note that even with the error messages, MS Fortran 5.0 WILL INDEED ... DOES produce the EXE and said EXE works the same. ...
    (comp.lang.fortran)
  • Re: Eval Errors
    ... >> longer printing the error messages yet the strange messages remain. ... >> That looks like a bug to me. ... > IIRC it was determined then that 'eval' focus was to allow testing of ... What warnings a piece of code ...
    (perl.beginners)
  • Re: Warning: constant expression violates subrange bounds
    ... and I get no warnings. ... It's that CONST Array that rises those messages. ... You could change the typing this way and make those error messages to go ... I can see that I have changed LongInt --> LongWord in 2004. ...
    (comp.lang.pascal.delphi.misc)
  • Re: Compilation error without stating any reason
    ... error there are several warnings but no error messages. ... Note the 'but no error messages', ... but only after the code compiles at all. ... might report an error without explicitly using the 'error' keyword. ...
    (comp.unix.programmer)