Lunarpages Web Hosting Forum

Author Topic: why would something work fine?  (Read 1484 times)

Offline Zorfox

  • Intergalactic Cowboy
  • *****
  • Posts: 74
    • http://forums.zorfox.net/
why would something work fine?
« on: March 23, 2003, 05:49:00 AM »
Okay, I have this code:

code:
#!/usr/bin/perl
use SOAP::Lite;
my $key='NONE OF YOUR BUSINESS';
# of course its not that



print "Content-Type: text/html\n\n";
my $googleSearch = SOAP::Lite -> service("file:GoogleSearch.wsdl");
my $result = $googleSearch -> doGoogleSearch($key, $query, 0, 10, "false", "", "false", "", "latin1", "latin1");


print "$result->{'estimatedTotalResultsCount'}";

( this involves the Google API )
 
Now, instead of giving a 500 server error, LIKE USUAL, it displays '0'. Of course, there are not 0 results to whatever i put in to $query... which (GASP!) is undefined. Why, when I have good code, it KILLS IT,  but when i've been bad, it displays?

by the way, I used $query because there was a query string variable called query. PHP automatically parses querystring or STDIN, and i was used to that.

just wanted to share STUPIDITY OF THE DAY.
cheese