<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">Qual a diferenca em colocar <br><br>open(FILE,"&lt;$filename).....<br><br>de<br><br>open my $file,"&lt;",$filename<br><br><br>e quando eu faco:<br><br>open my $file, $filename or die $!;<br>$data .= do { local $/; &lt;$file&gt;; }<br>close $file;<br><br><br><br>da erro de sintaxe: <br>syntax error at test.pl line 27, near "close"<br><br>Obrigada ;)<br><br><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">----- Mensagem original ----<br>De: Nelson Ferraz &lt;nferraz@gmail.com&gt;<br>Para: Cascavel Perl Mongers &lt;cascavel-pm@pm.org&gt;<br>Enviadas: Quarta-feira, 23 de Janeiro de 2008 2:07:14<br>Assunto: Re: [Cascavel-pm] expressao regular<br><br>&gt; Argh!!! O trecho do while(),
 acima, é feio. Alguém pode por favor<br>&gt; escrever um bom leitor de arquivos inteiros para a Patty?<br>&gt;<br>&gt; eu uso:<br>&gt;<br>&gt; my $data;<br>&gt; while( my $filename = glob( q{*.teste} ) ){<br>&gt;&nbsp; &nbsp; open my $file, $filename<br>&gt;&nbsp; &nbsp; &nbsp; and do { local $/ = undef; $data .= &lt;$file&gt;; }<br>&gt;&nbsp; &nbsp; &nbsp; and close $file<br>&gt;&nbsp; &nbsp; &nbsp; or die $!;<br>&gt; }<br><br>open and do and close or die ???<br><br>Eu prefiro o tradicional...<br><br>open my $file, $filename or die $!;<br>$data .= do { local $/; &lt;$file&gt;; }<br>close $file;<br>_______________________________________________<br>Cascavel-pm mailing list<br><a ymailto="mailto:Cascavel-pm@pm.org" href="mailto:Cascavel-pm@pm.org">Cascavel-pm@pm.org</a><br><a href="http://mail.pm.org/mailman/listinfo/cascavel-pm" target="_blank">http://mail.pm.org/mailman/listinfo/cascavel-pm</a><br></div><br></div></div><br>


      <hr size=1>Abra sua conta no <a href="http://br.rd.yahoo.com/mail/taglines/mail/*http://br.mail.yahoo.com/">Yahoo! Mail</a>, o único sem limite de espaço para armazenamento! 
</body></html>