in reply to Re: Running Perl program using backquotes
in thread Running Perl program using backquotes

Maybe I will when I figure out how the LWP module works. Being new to this, I'm not so interested in the best or most correct solution as I am in getting the damn thing to work in the first place. :-)

But thanks for the advice.

$PM = "Perl Monk's";
$MCF = "Most Clueless Friar;
$nysus = $PM . $MCF;

  • Comment on Re: Re: Running Perl program using backquotes

Replies are listed 'Best First'.
Re: Re: Re: Running Perl program using backquotes
by Beatnik (Parson) on Apr 18, 2001 at 14:38 UTC
    For plain GET calls, you can use LWP::Simple (if you dont need any specific referer, or cookie stuff)
    #!/usr/bin/perl -w use strict; use LWP::Simple; my $result = get(http://www.perlmonks.com/index.pl?node_id=131");
    With POST you'll need
    #!/usr/bin/perl -w use strict; use LWP::UserAgent; use URI::URL; my $WWWAgent = new LWP::UserAgent(); my $url=new URI::URL 'http://www.perlmonks.org/index.pl'; $url->query_form(node_id => "131"); my $WWWRequest = new HTTP::Request 'POST', $url->as_string() ; my $WWWResult = $WWWAgent->request($WWWRequest); die "Error logging in $WWWResult->code $WWWResult->message" if(!$WWWRe +sult->is_success); print $WWWResult->content;
    Greetz
    Beatnik
    ... Quidquid perl dictum sit, altum viditur.