|Think about Loose Coupling|
My first USEFUL script!by nefigah (Monk)
|on Mar 05, 2008 at 00:31 UTC||Need Help??|
nefigah has asked for the
wisdom of the Perl Monks concerning the following question:
Disclaimer: The script worked great, so no worries about getting it functional. Just looking for some commentary :)
So I use OS X Leopard (my first real experience with a Unix-like system, so I'm a noob in that area too), which comes with 5.8.8. After reading about some of the cool stuff in 5.10 I decided to go for it, and put it in /usr/local. I then wanted everything to use the new install by default, and not knowing anything really about how $PATHs work, here is the method I used:
I tried to apply what I learned about grep and map from my previous thread, but I went and used $_ explicitly again :\ (it's just too convenient).
I know in the future I'd want a better initial test than "files modified today" like what I used in the first line... it just seemed like the easiest way to get all the binaries created by the just-completed perl install.
I was very impressed that it ended up taking 4 lines of code!
So, on a scale of 1 to Retarded, how did it turn out? Braces himself.