Perl Help

Discussion in 'Computers' started by ThomasC, Oct 13, 2005.

  1. ThomasC

    ThomasC Lead Actor

    Joined:
    Dec 15, 2001
    Messages:
    6,526
    Likes Received:
    0
    When I'm trying to run this script, I get the following error in the browser:

    CGI Error
    The specified CGI application misbehaved by not returning a complete set of HTTP headers.

    I don't get any syntax errors when I go to the command line and run "perl -c test.pl", but when I run "perl -w test.pl", I get the following error:

    Use of uninitialized value in string at test.pl line 26.

    If I change line 26 to print OUTFILE "5";, the script runs fine and it works. Can anyone help me out, or suggest another forum to present my problem to? Thanks.

     
  2. John Mansor

    John Mansor Stunt Coordinator

    Joined:
    Jan 9, 2003
    Messages:
    218
    Likes Received:
    0
    For some reason $test is not getting created correctly. My guess would be something is wrong in your param() call when you are setting the value of $test.

    I would set $test = "5" to see if param() is the problem.
     
  3. Gary Seven

    Gary Seven Grand Poo Pah

    Joined:
    Aug 15, 2003
    Messages:
    1,644
    Likes Received:
    180
    Location:
    Lake Worth, Florida
    Real Name:
    Gaston
    Typically I do something like this...

    use CGI qw(:cgi-lib :standard);

    $qry=new CGI;

    $test = $qry->param("testvar");

    Try that.
     

Share This Page