Perl: Fetch HTTPS content
If you need to fetch a remote URL via HTTPS in a Perl script the easiest way I have found is to use HTTP::Tiny
. HTTP::Tiny
is a core module, and included in all Perl installations.
Sample code:
use HTTP::Tiny;
my $http = HTTP::Tiny->new(verify_SSL => 1, timeout => 5);
my $resp = $http->get("https://www.perturb.org/");
my $body = $resp->{content};
print $body;