Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

LWP::Simple

  • LWP::Simple}
#!/usr/bin/perl
use strict;
use warnings;

my $url = 'http://localhost:5000/';
if (defined $ARGV[0]) {
    $url = $ARGV[0];
}

use LWP::Simple qw(get);

my $page = get($url);
if (defined $page) {
    print $page;
} else {
    print "Could not fetch $url\n";
}
print "\n";

42