The way to fix that would be to change the test to
if (-d $file && ! -l $file)
Also possibly change the syntax check to:
die "Syntax: $0 <dir>" unless @ARGV == 1 &&
(-d $ARGV[0] && ! -l $ARGV[0]);
--ZZamboni
| [reply] [d/l] [select] |
If you're going to say the code is bad, at least suggest a fix. Fortunately ZZamboni already has. | [reply] |
My "fix" is the normal fix. Use File::Find, or suggest patches to
it if it doesn't work the way you want. That way I don't have to review every
line of your code in code-review to find out if you've broken it on some platforms,
or introduced a security hole.
The cost of revinventing the wheel is not just in development, but in every phase
afterward: testing, documenting, production, and maintenance.
-- Randal L. Schwartz, Perl hacker
| [reply] |
Thanks.
Althought "the normal fix" may be apparent to you, it may not be as apparent to the many other people who read the site.
| [reply] |