| Pat Rice 2007-09-27, 7:01 pm |
| 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
|