in reply to question about variables from new perl user
Output was:#!/usr/bin/perl use strict; use warnings; use LWP::Simple; my $req = head("http://perlmonks.com"); # request if ($req) { print "protocol:\n\t", $req->protocol, "\n"; print "headers->etag:\n\t", $req->headers->{etag}, "\n"; # a leading underscore is considered 'private' # and probably should not be accessed print "_rc:\n\t", $req->{_rc}, "\n"; print "request->uri:\n\t", $req->request->uri, "\n"; print "request->headers->{'user-agent'}:\n\t", $req->request->headers->{'user-agent'}, "\n"; }
protocol: HTTP/1.1 headers->etag: "e047-525cb6d2fef00" _rc: 200 request->uri: http://perlmonks.com request->headers->{'user-agent'}: LWP::Simple/6.00 libwww-perl/6.02
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: question about variables from new perl user
by Apero (Scribe) on Dec 01, 2015 at 01:38 UTC | |
by rst (Initiate) on Dec 01, 2015 at 02:04 UTC | |
by GrandFather (Saint) on Dec 01, 2015 at 04:06 UTC |