programming-examples/perl/Network/Setting a User Agent and Retrieving a Web Page.pl
2019-11-15 12:59:38 +01:00

10 lines
275 B
Perl

#!/usr/bin/perl -w
use LWP;
use strict;
my $browser = LWP::UserAgent->new(agent => 'Perly v1');
my $result = $browser->get("http://www.braingia.org/ewfojwefoj");
die "An error occurred: ", $result->status_line() unless $result->is_success;
print $result->content;