note
graff
One more small detail, which probably won't be significant unless you happen to be scanning very large quantities of files, links and/or directories: you can use the special operand "_" (the underscore character) on the file-test operators, in order to use the file stat information from the previous stat call (so you don't do repeated stat calls on the same file). Adapting the most recent suggestion from [Athanasius]:
<c>
sub cleanup
{
for (glob $_[0])
{
cleanup_link($_) when -l;
cleanup_dir ($_) when -d _;
cleanup_file($_) when -f _;
}
}
</c>
1003275
1003293