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);

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 pag +e 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 : $u +rl"; 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 pi +ck 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 st +atment 56 ############ Split The file, and pick out t +he correct word for time and date. 57 ##I'm picking out what I want out of the web p +age here 58 ($img, $src, $alt, $a, $href) = split (' ', $l +ine); 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

In reply to running cgi off the command line works, but running on the browser fails with a 500 error by pat_rice_irl

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.