perleager has asked for the wisdom of the Perl Monks concerning the following question:
opendir(ims, "/home/tanglam/www/$Account::cata_acc/_data/messages"); @imss = grep !/\.\.?/, readdir MESSAGE; closedir(ims); foreach $imfile (@imss) { unlink("/home/tanglam/www/$Account::cata_acc/_data/messages/$imfile") +|| print "Error deleting message"; }
opendir(ims, "/home/tanglam/www/$Account::cata_acc/_data/messages"); @imss = grep !/\.\.?/, readdir MESSAGE; unlink(@imss); closedir(ims);
2001-03-25 Edit by Corion : Closed final CODE tag
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: deleting a list of files
by Anonymous Monk on Mar 25, 2001 at 12:42 UTC | |
by merlyn (Sage) on Mar 25, 2001 at 19:15 UTC | |
by larryl (Monk) on Mar 25, 2001 at 20:01 UTC | |
by merlyn (Sage) on Mar 25, 2001 at 21:18 UTC | |
by larryl (Monk) on Mar 25, 2001 at 21:35 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |