Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Re: File::Find considered hard?by crabbdean (Pilgrim) |
on Mar 14, 2004 at 21:37 UTC ( [id://336539]=note: print w/replies, xml ) | Need Help?? |
I think the reason people have problems with map {code} array is two fold. One: Usually a programmer will learn "foreach" commands first, and then stick to what they know. Two: its a matter of linguistics - programming in itself is based/modelled on the mental conventions of the natural human thought process. Linguistically we are more likely to say and think "for each item in this array do blah blah" rather than "map this code to each element of this array". Its just a human tendency. (my honest opinion). UPDATE: Just curious, which way is faster? After some experience now with the File::Find module ... hmm .. my comments ... Its frought with danger and not a "clean" piece of programming. It also took me a while to get use to the idea of how it was to be used. I avoid it now and prefer using my own code. Oh, and that it crashed one of our servers because of its memory leaking "features". Personally I think its needs to be rewritten, considering directory traversing is a such common task. Dean The Funkster of Mirth Programming these days takes more than a lone avenger with a compiler. - sam RFC1149: A Standard for the Transmission of IP Datagrams on Avian Carriers
In Section
Meditations
|
|