use warnings; use strict; use LWP::UserAgent; my $ua = LWP::UserAgent->new; my $url = 'http://www.google.com'; print $ua->head($url)->as_string; #### HTTP/1.1 200 OK Cache-Control: private, max-age=0 Connection: close Date: Sat, 24 May 2014 04:17:59 GMT Server: gws Content-Type: text/html; charset=ISO-8859-1 Expires: -1 Alternate-Protocol: 80:quic Client-Date: Sat, 24 May 2014 04:16:04 GMT Client-Peer: 174.194.08.94:80 Client-Response-Num: 1 P3P: CP="This is not a P3P policy! See http://www.google.com/support/accounts/bin/answer.py?hl=en&answer=151657 for more info." Set-Cookie: PREF=ID=6be73c938c0eb2c2:FF=0:TM=1400905079:LM=1400905079:S=d_WzZRSOQ6IZBvFA; expires=Mon, 23-May-2016 04:17:59 GMT; path=/; domain=.google.com.ng Set-Cookie: NID=67=bU9SctXcLKJvZuBUQclTeWSIIJPWwD579z8_VsFNdP9AtU2dVx_5_rpEj_AGQIvcXVqeV3xka5H9aGSX_SN62h-bQ70smhmQ77HRB3o0uTsdUFnNeNU0u--x2IYvBj8c; expires=Sun, 23-Nov-2014 04:17:59 GMT; path=/; domain=.google.com.ng; HttpOnly X-Frame-Options: SAMEORIGIN X-XSS-Protection: 1; mode=block