Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Dynamicly Execute URL without redirection

by Anonymous Monk
on Feb 11, 2004 at 15:56 UTC ( #328293=perlquestion: print w/replies, xml ) Need Help??

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

I have a URL that I would like to execute. I need variables in the URL to be posted correctly like this:

I just dont want to redirect.

I so far have tried all of these things:

print qx ""; system("");use my $response =LWP::UserAgent->new->get("" +);


20040211 Edit by Corion: Exchanged PRE tags for formatting

Replies are listed 'Best First'.
Re: Dynamicly Execute URL without redirection
by tcf22 (Priest) on Feb 11, 2004 at 16:00 UTC
    You have to specify the whole URL so
    my $response =LWP::UserAgent->new->get("");
    should be what you want.

    If you just want to run the script, then LWP::UserAgent may be overkill. LWP::Simple will probably do what you want.
    use LWP::Simple; my $data = get("" +);

    - Tom

Re: Dynamicly Execute URL without redirection
by valdez (Monsignor) on Feb 11, 2004 at 19:29 UTC

    If you want a correct URL use the URI module to build it, for example:

    $uri = URI->new(''); $uri->query_form( 'var1' => $var1, 'var2' => $var2 ); $page = get( $uri->as_string );

    HTH, Valerio

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://328293]
Approved by Corion
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2023-02-06 12:42 GMT
Find Nodes?
    Voting Booth?
    I prefer not to run the latest version of Perl because:

    Results (34 votes). Check out past polls.