[Rio-pm] Listagem de Arquivos

Ailton Zacarias ailtonzsilva em gmail.com
Sexta Agosto 20 07:22:46 PDT 2010


Bom dia Amigos

Gostaria de saber onde estou errando ... pq na listagem de arquivos ele
duplica os nomes de arquivos??? Obrigado!


use strict;
use warnings;

my $diretorio="C:/Tmp/e-Mails/ENVIADOS";
opendir(IMD, $diretorio) || die("Cannot open directory");
my @thefiles= readdir(IMD);
closedir(IMD);

my $produrar = 'ALLTASKS';

open(ARQ1,">Lista.html");
print ARQ1 "<html><head><title>Listagem de arquivos</title></head>\n";
print ARQ1 "<body><h1>Listagem de Arquivos\n";


foreach my $f (@thefiles)
{
 unless ( ($f eq ".") || ($f eq "..") )
 {
  my @arquivos = grep(/^$produrar/, em thefiles);
foreach my $Nome(@arquivos)
 {
  print ARQ1 "<table><td><a
href=".$diretorio."/".$Nome.">".$Nome."</a></td></table>";
 }
 }
}

print ARQ1 "</body></html>\n";
close(ARQ1);




-- 
Ailton Zacarias
F4 Computer – Soluções em Tecnologia da Informação
Tel: 55 +11 4062-0180 (Ailton)
Cel: 55 +11 8405-8334
MSN: ailton em f4computer.com
Skype: ailton.zacarias
http://www.f4computer.com
-------------- Próxima Parte ----------
Um anexo em HTML foi limpo...
URL: <http://mail.pm.org/pipermail/rio-pm/attachments/20100820/8546b95b/attachment.html>


Mais detalhes sobre a lista de discussão Rio-pm