/docs/MyDocs

To get this branch, use:
bzr branch http://darksoft.org/webbzr/docs/MyDocs

« back to all changes in this revision

Viewing changes to Development/languages/perl/Examples/headers.pl

  • Committer: Suren A. Chilingaryan
  • Date: 2009-04-09 03:21:08 UTC
  • Revision ID: csa@dside.dyndns.org-20090409032108-w4edamdh4adrgdu3
import

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/perl
 
2
use LWP::UserAgent;
 
3
use HTTP::Headers;
 
4
use HTTP::Response;
 
5
use HTTP::Request;
 
6
use URI::URL;
 
7
 
 
8
sub prnhdr
 
9
{
 
10
        ($name,$value)=@_;
 
11
        print $name,": ",$value,"\n";
 
12
}
 
13
 
 
14
$url=new URI::URL("http://warrax.croco.net");
 
15
$req=new HTTP::Request("GET",$url);
 
16
$ua=new LWP::UserAgent;
 
17
$resp=$ua->request($req);
 
18
$hdr=$resp->headers();
 
19
$hdr->scan(\&prnhdr);
 
20
#print $resp->content;