in reply to Anonymous Subroutines
What File::Find does for you is to descend through one or more trees of directories, and it runs some user defined code at each point through the tree. So the author designed around the idea of passing in a code reference to an arbitrary routine which can you can call anything you want. In this example it's "wanted", in another application it might be "unlink_big_files".use File::Find; find(\&wanted, @directories_to_search); sub wanted { ... }
(There's a strong argument that this File::Find interface was a bad idea, and it has a number of competitors these days like File::Find::Rule, but still if you're working on existing code, you're likely to see File::Find used.)
Maybe you should try and give us a better idea of what you don't get about anonymous subs...
|
|---|