File: fetch_faq.pl

package info (click to toggle)
libgtk2-perl 1%3A1.190-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 4,132 kB
  • ctags: 516
  • sloc: perl: 16,575; sh: 149; ansic: 148; makefile: 76
file content (31 lines) | stat: -rw-r--r-- 598 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/perl

use strict;
use warnings;
use LWP;

my $faq_url = 'http://gtk2-perl.sourceforge.net/faq/?op=pod';
my $podi_file = 'build/FAQ.pod';

my $ua = LWP::UserAgent->new;
$ua->agent ("Gtk2-Perl FAQ Fetcher");
$ua->env_proxy;

my $req = HTTP::Request->new (POST => $faq_url);
$req->content_type ('plain/text');
print "Requesting $faq_url...";
my $res = $ua->request ($req);
if ($res->is_success)
{
	open PODI,'>'.$podi_file 
		or die "unable to open ($podi_file) for output\n";
	print PODI $res->content;
	close PODI;
}
else
{
	die "request of ($faq_url) failed\n";
}
print "...Done\n";

1;