my $content = $response->content; my $encoding = "utf8"; # assume this is the default if($content =~ /encoding="([^"]+)"/) { $encoding = $1; } $content = $response->decoded_content((charset => $encoding)); print $content;