<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18928">
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial>Estou usando algo como o código abaixo para ler uma 
porta.</FONT></DIV>
<DIV><FONT size=2 face=Arial>Minha dúvida.</FONT></DIV>
<DIV><FONT size=2 face=Arial>Tem como ler uma faixa de portas?</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV><FONT size=2 face=Arial>
<DIV><BR><FONT face="Courier New">use warnings;<BR>use strict;<BR>use 
IO::Socket;</FONT></DIV>
<DIV><FONT face="Courier New"></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New">$| = 1;</FONT></DIV>
<DIV><FONT face="Courier New"></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New">my $porta&nbsp;&nbsp;&nbsp; = '9999';<BR>my 
$telefone = '999999999999';<BR>my $retorno&nbsp; = '';<BR>my 
$linha&nbsp;&nbsp;&nbsp; = '';<BR>my $new_sock = '';</FONT></DIV>
<DIV><FONT face="Courier New"></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New">my $DIRTEMP = 'c:/temp/log';<BR>my $arquivo = 
$DIRTEMP."/arquivo.log";</FONT></DIV>
<DIV><FONT face="Courier New"></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New">my $sock = new IO::Socket::INET 
(<BR>&nbsp;&nbsp;&nbsp;&nbsp; LocalPort =&gt; 
$porta,<BR>&nbsp;&nbsp;&nbsp;&nbsp; Type&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&gt; 
SOCK_STREAM,<BR>&nbsp;&nbsp;&nbsp;&nbsp; Proto&nbsp;&nbsp;&nbsp;&nbsp; =&gt; 
'tcp',<BR>&nbsp;&nbsp;&nbsp;&nbsp; Listen&nbsp;&nbsp;&nbsp; =&gt; 
10<BR>);<BR>die "Não consegui iniciar o servidor: $!\n" unless $sock;<BR>print 
"Servidor iniciado ...\n";</FONT></DIV>
<DIV><FONT face="Courier New"></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New">while (my $new_sock = $sock-&gt;accept()) 
<BR>&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while(my $data = 
&lt;$new_sock&gt;) <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (my 
$sec,my $min,my $hour,my $mday,my $mon,my $year,my $wday,my $yday,my 
$isdst)=localtime(time);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
my $dataHoraT = sprintf("%4d-%02d-%02d %02d:%02d:%02d",($year + 1900),($mon + 
1),$mday,$hour,$min,$sec);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
my $dataHoraA = sprintf("%4d-%02d-%02d|%02d:%02d:%02d",($year + 1900),($mon + 
1),$mday,$hour,$min,$sec);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print 
$dataHoraT.' 
'.$telefone."\n";<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; open 
(OUTFILE,"&gt;&gt;$arquivo");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
print OUTFILE 
$dataHoraA.'|'.$telefone.'|'.$data."\n";<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
close 
(OUTFILE);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
$data&nbsp;&nbsp;&nbsp;&nbsp; = 
'NULO';<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
$new_sock = 'NULO';<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
}<BR>&nbsp;&nbsp; }<BR>close($sock);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><BR></FONT>&nbsp;</DIV></BODY></HTML>