in reply to Concat Error, but I'm not concatenating??

Most likely you have an undefined variable in the here doc that is following the mentioned line.

Abigail

  • Comment on Re: Concat Error, but I'm not concatenating??

Replies are listed 'Best First'.
Re: Re: Concat Error, but I'm not concatenating??
by ecuguru (Monk) on Apr 04, 2004 at 06:20 UTC
    Found the problem, but still not sure how to make a solution out of it.
    I have a web interface for the perl script. html page with 9 input values making a get request.
    I also have a perl script that sends data directly to the perl script.
    The perl script only passes 3 of the values using lwp, causing the undefined error for the other 6 variables.

    So anytime I submit data through the webpage, I don't get any errors. When my other perl scripts post data to the collector script, they don't pass the other values. I guess I could have my external scripts post null data like:
    $val = ""; $val2 = "123"; $url = "http://localhost/get.pl?&val1=".$val."&val2=".$val2; giving http://localhost/get.pl?&val1=&val2=123
    I think that should make the values defined in my collector script?
    The rest of my other sub is included, but the above is certainly the problem. It's important that my script know whether the user intended to include data with his get, so I need to be able to differentiate the difference between 0 and null.
    Thanks!
    sub happy(){ print << "THANKS"; Content-type: text/html <HTML> <HEAD> <TITLE>Trackerhappy :-)</TITLE> </HEAD> <BODY> ID: $node<br> Lat: $lat<br> Lon: $lon<br> </BODY> </HTML> THANKS }
      $node, $lat or $lon are undefined. When you assign the values, add an || ''; - if it's ok for them to be empty. Eg
      $node = defined $q->param('node') ? $q->param('node') : '';
      cLive ;-)