#!/usr/bin/perl -ws use strict; use warnings; our($xml,$txt,$html); my $options = ""; $options.=" -html " if $html; $options.=" -txt" if $txt; my $text=""; my $limit = 4950; #my $outfile = shift; #unlink $outfile; while(<>){ my $x = length $text; my $y = length $_; if (($x + $y) > $limit){ send_text($text); $text=""; } $text.=$_; } send_text($text); sub send_text{ my $text=shift; #open OUT, "| perl plp $options >> $outfile"; open OUT, "| perl plp $options"; print OUT $text; close OUT; } =head1 NAME plp_flood - Envia um dado texto para conversao em bocados aceitaveis pelo Conversor Online do Portal da Lingua Portuguesa. =head1 SYNOPSIS plp_flood [option] file > file2 =head1 DESCRIPTION Converte um dado texto para o novo Acordo Ortografico, usando o conversor online do Portal da Lingua Portuguesa. =head2 Options B<-html> Cria um ficheiro plp.html com o resultado do pedido. B<-txt> Limpa as tags html que rodeiam cada palavra alterada =head1 AUTHOR Andre F. Santos, pg15973@alunos.uminho.pt =head1 SEE ALSO perl(1) =cut __DATA__