Yay Perl

krellis on 2002-02-07T23:05:43

And now for my Perl success story of the day... found out today that our NetApp/Samba server had been conspiring to cause piles of directories in our web docs tree to be created with 0777 file modes. Ouch! Find tells me that there are, in fact, over 14,000 of these directories. All with twisty little exceptions to the simple thought of "oh, I'll just chmod them". Argh.

Luckily, File::Find and File::spec came to the rescue! With this combination, I was able to come up with a nice little function that does what I need it to do with the files - and it'll be really handy for some other things I've been putting off, too. One of those times that I really love Perl. No nasty manually chmod'ing 14,000 directories any more! :)

And I don't think I'm ever going to use "real" find again, either - File::Find just gives me soooo much more flexibility, and means I don't have to read the stupid find manpage to figure out what I want. Just plug in the right conditions in a function, give File::Find::find() a reference to it, and wham!