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
}
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.