Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hello!

I can construct a URL + query string and successfully send this to a server through LWP::UserAgent and get the desired response.

What I am curious about is whether there may be a way to programmatically pass this to the browser and have it executed the same GET statement. I can manually cut-and-paste this URL and get the desired results, but being able to do the same through code would be preferable. Is there a way to do this?

Thanks for your time!

Replies are listed 'Best First'.
Re: sending URL + query string?
by ikegami (Patriarch) on Jun 09, 2009 at 00:13 UTC
    Windows?
    system("start $url");

    The URL can be generated using URI's query_form

Re: sending URL + query string?
by JavaFan (Canon) on Jun 09, 2009 at 00:20 UTC
    What I am curious about is whether there may be a way to programmatically pass this to the browser and have it executed the same GET statement.
    That would of course depend on the browser. It's hardly a Perl question.
    my $browser = "/path/to/browser"; my $URL = "http://www.foo.xx/yada/yada?query"; system $browser, $URL;
    works for my browser. Other browsers may not accept remote commands. Or need specific options. Read your browsers manual page.
Re: sending URL + query string?
by ig (Vicar) on Jun 09, 2009 at 02:38 UTC

    If you are interested in more than just launching IE with a URL, Win32::IEAutomation might help.

Re: sending URL + query string?
by Anonymous Monk on Jun 09, 2009 at 00:05 UTC