2010/5/20 Patty Silva <<a href="mailto:ptfzs@yahoo.com.br">ptfzs@yahoo.com.br</a>>:<br>> Eu achava que o comando:opendir(DIR, $dir) ........<br>> Nao precisaria do diretorio :)<br><br>perldoc -f readdir<br><br>
readdir DIRHANDLE<br> Returns the next directory entry for a directory opened by "opendir". If used in list context, returns all the rest of the entries<br> in the directory. If there are no more entries, returns an undefined value in scalar context or a null list in list context.<br>
<br> <b>If you’re planning to filetest the return values out of a "readdir", you’d better prepend the directory in question.</b> Otherwise,<br> because we didn’t "chdir" there, it would have been testing the wrong file.<br>
<br> opendir(DIR, $some_dir) ││ die "can’t opendir $some_dir: $!";<br> @dots = grep { /^\./ && -f "$some_dir/$_" } readdir(DIR);<br> closedir DIR;<br>