#!/usr/bin/perl -ws use strict; use warnings; use HTML::TreeBuilder; our($xml,$txt,$html); my ($final, $text); { local $/; $text = <>; } use WWW::Mechanize; my $browser = WWW::Mechanize->new(); my $url = "http://www.portaldalinguaportuguesa.org/index.php?action=convertor"; my $response = $browser->post($url, ['sourceao' => 1945, 'submit' => 'converter', 'text'=>$text]); if ($response->is_success) { my $tree = HTML::TreeBuilder->new; $tree->parse($response->content); my @divs = $tree->look_down('style'=> qr{background-color}); my $act = $divs[1]; if ($txt) { $final = $act->as_text} else{ $final = $act->as_XML; $final =~ s/^(?: