#!/usr/local/bin/perl use strict; use warnings; use feature ':all'; use LWP::UserAgent; use HTTP::request; my $url = 'https://www.exmaple.org'; my $ua = LWP::UserAgent->new; my $req = HTTP::request->new(GET => $url); my $res = $ua->request($req); use Data::Dumper; say Dumper($res->header);