Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Getting more out of LWP::Simple

by Dog and Pony (Priest)
on May 20, 2002 at 16:28 UTC ( #167861=perlmeditation: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download

  1. or download this
    # Note that if you do this, you must explicitly
    # export everything you want to use:
    my $html = get $webpage || die "Timed out!";
  2. or download this
    $ua->agent('My agent/1.0');
  3. or download this
    use LWP::Simple qw($ua get);
    use HTTP::Cookies;
    get $webpage . $login_string;
    my $logged_in_page = get $webpage . $private_page;
  4. or download this
    use LWP::UserAgent;
    $response = $ua->request($request);
    my $html = $response->content;
  5. or download this
    perl -MLWP::Simple -e "getprint ''"
    perl -MLWP::Simple -e "getprint '
  6. or download this
    perl -MLWP::Simple -e "get ' and
    + Pony&passwd=doNotUseThisPW&op=message&message=Hi it is me on the com
    +mand line!'"
  7. or download this
    my $words = 'LWP::Simple tutorial'
    my $html = get "$words";
  8. or download this
    my $response_code = mirror $webpage, 'webpage.html';
    die "Bad response $response_code" unless is_success($response_code);
  9. or download this
    use LWP::Simple;
    print "$webpage exists and server is up!\n" if (head($webpage));
  10. or download this
    my @headers = head $webpage;
    print join "\n", @headers;

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://167861]
Approved by scain
Front-paged by cjf
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2015-10-09 21:50 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (252 votes), past polls