Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: What makes File::Find's interface so commonly hated

by tphyahoo (Vicar)
on Jul 17, 2006 at 10:46 UTC ( #561729=note: print w/ replies, xml ) Need Help??


in reply to What makes File::Find's interface so commonly hated

Everybody who hates File::Find should try the find2perl utility that comes bundled with perl.

find2perl > my-find-script-template.pl chmod u+x my-find-script-template.pl

It's totally boneheaded utility. As far as I can tell, all it does is output the template for a basic file finder with perl, which you can then modify per your requirements.

Well, actually, it's a little more powerful than that, but I never figured out how to give arguments to this script. I just output and tweak.

And yet... and yet... what a help that is!

Try it if you haven't. :)


Comment on Re: What makes File::Find's interface so commonly hated
Download Code
Re^2: What makes File::Find's interface so commonly hated
by Aristotle (Chancellor) on Jul 17, 2006 at 13:47 UTC

    Itís not that I have trouble figuring out how to use File::Find, and I doubt all the experienced programmers who are outspoken about its interface have any either. Iíve made it do a lot of things it was probably never meant to. But doing simple things is much less simple than it could be, and some of the hard things are not even possible at all Ė in short, the interface runs counter to general Perl philosophy.

    Makeshifts last the longest.

      Maybe more experienced people and less experienced people hate File::Find in a different way.

      ;)

      As for me, I've learned to appreciate it, like a cranky old table saw that isn't always completely predictable, but that I rely on to get the job done.

Re^2: What makes File::Find's interface so commonly hated
by qbxk (Friar) on Jul 18, 2006 at 17:19 UTC
    haha, they think constants are annoying too:
    ~ $ find2perl =snip # for the convenience of &wanted calls, including -eval statements: use vars qw/*name *dir *prune/; *name = *File::Find::name; *dir = *File::Find::dir; *prune = *File::Find::prune; =snip

    Hey good find on the find2perl script! i like it

    It's not what you look like, when you're doin' what youíre doin'.
    It's what youíre doin' when youíre doin' what you look like youíre doin'!
         - Charles Wright & the Watts 103rd Street Rhythm Band, Express yourself

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://561729]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (12)
As of 2014-07-22 13:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (113 votes), past polls