Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

5
Task/HTTP/Perl/http-1.pl Normal file
View file

@ -0,0 +1,5 @@
use strict; use warnings;
require 5.014; # check HTTP::Tiny part of core
use HTTP::Tiny;
print( HTTP::Tiny->new()->get( 'http://rosettacode.org')->{content} );

3
Task/HTTP/Perl/http-2.pl Normal file
View file

@ -0,0 +1,3 @@
use LWP::Simple qw/get $ua/;
$ua->agent(undef) ; # cloudflare blocks default LWP agent
print( get("http://www.rosettacode.org") );

9
Task/HTTP/Perl/http-3.pl Normal file
View file

@ -0,0 +1,9 @@
use strict;
use LWP::UserAgent;
my $url = 'http://www.rosettacode.org';
my $response = LWP::UserAgent->new->get( $url );
$response->is_success or die "Failed to GET '$url': ", $response->status_line;
print $response->as_string