ou usa em LIST-context - assim pode re-fechar o handle imediatemente depois:<div><span class="Apple-style-span" style="font-family: monospace; font-size: medium; white-space: pre-wrap; "><br></span></div><div><span class="Apple-style-span" style="font-family: monospace; font-size: medium; white-space: pre-wrap; ">opendir my $dir_fh, $dir_name or croak qq{\ncannot open dir $dir_name};</span></div>
<div><span class="Apple-style-span" style="font-family: monospace; font-size: medium; white-space: pre-wrap; ">my @list = readdir $dir_fh;</span></div><div><span class="Apple-style-span" style="font-family: monospace; font-size: medium; white-space: pre-wrap; ">close $dir_fh;</span><div>
<span class="Apple-style-span" style="font-family: &#39;Times New Roman&#39;; font-size: medium; "><pre style="word-wrap: break-word; white-space: pre-wrap; ">for (@list) {...</pre><pre style="word-wrap: break-word; white-space: pre-wrap; ">
<br></pre></span></div></div>-- <br>Daniel S. T. Hughes M.Biochem (Hons; Oxford), Ph.D (Cambridge)<br>-------------------------------------------------------------------------------------<br>+55 21 8344 9098<br><a href="mailto:dsth@cantab.net">dsth@cantab.net</a><br>
<a href="mailto:dsth@cpan.org">dsth@cpan.org</a><br><a href="http://search.cpan.org/~dsth/">http://search.cpan.org/~dsth/</a><br>