use strict;
use LWP::UserAgent;
my @captions;
my $ua = LWP::UserAgent->new();
my $response = $ua->get('http://www.1418.ru/chronicles.php?p=100');
if ($response->is_success) {
my $file = $response->content;
$file =~ m/
(.*)<\/h3>/i;
my $h3_content = $1;
push @captions, $h3_content;
} else {
warn 'ERROR: no HTML ',$response->status_line;
}
open TEST, ">", "test.txt" or die $!;
print TEST $captions[0];
close TEST;