Нашёл способ забить хедеры как нужно, но после этого процедура перестала адекватно работать.
Что в ней не так?
sub get_page
{
my $uri = shift;
my $content = shift;
my $ref = shift;
$uri =~ /^http:\\/\\/(.*?)\\/(.*?)/;
my $host = $1;
my $link = $2;
my $ua = LWP::UserAgent->new;
$ua->cookie_jar(HTTP::Cookies->new(file => "lwpcookies.txt", autosave => 1));
$ua->agent(\'Mozilla/5.0 (Windows; U; Windows NT 5.2; ru; rv:1.8.0.3) Gecko/20060426 Firefox/1.5.0.3\');
$ua->default_header(\'Host\' => $host);
$ua->default_header(\'Accept\' => \'text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5\');
$ua->default_header(\'Accept-Language\' => \'ru-ru,ru;q=0.8,en-us;q=0.5,en;q=0.3\');
$ua->default_header(\'Accept-Encoding\' => \'gzip, deflate\');
$ua->default_header(\'Accept-Charset\' => \'windows-1251,utf-8;q=0.7,*;q=0.7\');
$ua->default_header(\'Keep-Alive\' => \'300\');
$ua->default_header(\'Connection\' => \'keep-alive\');
$ua->default_header(\'Content-Type\' => \'application/x-www-form-urlencoded\');
$ua->default_header(\'Referer\' => $ref);
my $req = HTTP::Request->new(POST => $uri);
$req->content($content);
my $rez = $ua->request($req);
return $rez;
}