Ask any experienced Perl programmer which core module has the most abysmal interface, and they'd probably say File::Find. (...)
I bet you all have heard/read similar sentences before. The problem is that I simply do not understand them. Why does the concept of passing a function as an argument to another function look so strange and hard to grok to all those people? Why do they consider an interface as simple as "find all files in THESE directories and do THIS with them" abysmal? How is
harder to understand thanfind( sub {print $_,"\n"}, '.');
. (I know these two do not mean the same thing.)while ($_ = readdir DIR) { print $_,"\n"; }
Why do so many people have such huge problems to understand map {code} @aray yet foreach (@array) { code } looks natural to them? :-(
Jenda
Always code as if the guy who ends up maintaining your code
will be a violent psychopath who knows where you live.
-- Rick Osborne
P.S.: Quite some time ago I asked on a VB forum how do I make a reference to a function in VB. They could not even understand why would anyone want to do such thing :-(
In reply to File::Find considered hard? by Jenda
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |