usr bin perl use strict use warnings use LWP Simple use Text Iconv my

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
#!/usr/bin/perl
use strict;
use warnings;
use LWP::Simple;
use Text::Iconv;
my $iconv = Text::Iconv->new("utf8", "koi8-r");
my $html = get('http://www.linux.org.ru/section-rss.jsp?section=1');
my @html_l = split("\n",$html);
for(my $i=0;@html_l>$i;$i++){
$html_l[$i]=~ s/<title>(.*?)<\/title>//;
if($1){
my $text = $1;
$text = $iconv->convert("$text");
print "$text\n";
}
}