in reply to Re^2: Unable to execute URL from perl/cgi script
in thread Unable to execute URL from perl/cgi script

Sorry but I'm still not quite clear on what you are trying to do. But I'm going to wager two guesses: 1. Do you want to fetch the page from the URL and display it to the user? In that case, you could drop the start_html() and end_html() calls and simply say print $data; - However, note your script currently does no error handling, and this would only reliably work for plain HTML pages; if you have images, CSS files, etc. those may or may not work correctly depending on how they are referenced in the HTML.

Or, 2. Do you want to redirect the user to the new URL? In that case, look at the redirect function from CGI (section "Generating a redirection header"), and note that you should not output anything else (i.e. no header(), no start_html(), etc.)

Note that you really, really should be doing use warnings; use strict; at the top of your script. See Use strict and warnings.

If I am still misunderstanding what you want to do then what might help would be if you could give a step-by-step explanation of the expected behavior of the user and your script.