use strict; use warnings; use XML::RSS::Tools; use LWP::UserAgent; my $rss_feed = XML::RSS::Tools->new; my $ua = LWP::UserAgent->new; $ua->agent('Camel Power 3.14.15 [rss])'); my $rss = "http://www.perl.com/pace/news.rss"; my $request = HTTP::Request->new(GET => $rss); my $response = $ua->request($request); my $status = $response->status_line; my %errors = ('500'=>'Bad hostname supplied', '501'=>'Protocol not supported', '404'=>'URL not found', '403'=>'URL forbidden', '401'=>'Authorization failed', '400'=>'Bad request found', '302'=>'Redirected URL' ); ($status) = ($status =~ /(\d+)/); if (defined($errors{$status})) { die "ERROR: $errors{$status}\n"; } else { my $content = $response->content; $rss_feed->rss_string($content); $rss_feed->xsl_file('rss.xsl'); $rss_feed->transform; print $rss_feed->as_string; }
I'll hit it with benchmark and see if maybe one of the other feching modules can do the same thing faster. Any suggestions on alternate modules that can do the same thing? What I require is:
In reply to Re: Overriding module-internal calls
by hacker
in thread Overriding module-internal calls
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |