Question:
Problems Calling Perl CGI Script from Google Earth?
wetwilly543
2008-05-13 11:43:12 UTC
I am trying to call a CGI script from the Network Link feature in Google Earth. I can call the script as long as it doesn't contain any parameters. Google Earth throws a parsing error when it sees the "&" in the URL. Is there a special way to invoke the script if it has parameters in Google Earth? Before I converted the Perl Program to CGI, it ran flawlessly. I had a string variable at the top of it that mimmicked the "$ENV{QUERY_STRING}" when it was the regular perl program. I took it out and replaced it with the real thing. I also added the CGI header line saying what type of application it is. ANy ideas?
Three answers:
Rosco
2008-05-13 15:31:56 UTC
I believe you need to "url encode" the string before you enter it into google, and (potentially) decode it in your perl script.

http://en.wikipedia.org/wiki/Url_encoding



If you have any of these Perl modules available to you, they include functions for encoding/decoding:

CGI, CGI::Simple, CGI-Minimal
mti2935
2008-05-13 12:06:43 UTC
Strange that google earth would choke on the & symbol. Is there a different symbol that you can use in the query string to separate the name/value pairs that google earth won't choke on? If so, then you may be able to work around the problem using that symbol instead, and just change how you parse the query string in the perl script.
?
2016-05-23 14:29:51 UTC
You need to read The Idiot's Guide (link below, DON'T take the title personally 8-)


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...