Having a Little Fun with Bash Scripts and Perl Installations
Today I was trying to clean up a script we use at the Shop for equalizing perl on the different platforms around the place. We all need some variable of perl 5.8, but if it's 5.8.3 versus 5.8.8, it's not that big a deal. However, all perl implementations need to be able to have CPAN, plus database access which means that they have been linked against the right libraries for each version.
The problem is that this sounds easy, but in reality, there's a disconnect and not every build of perl available on the network mounts is built similarly. Some have database access, others don't. It's a bit of hit-n-miss.
Yesterday I was working on a perl script to monitor one of my tick injectors, and realized that in order to get perl working on these new boxes I had to enumerate all the hostnames. That is just far too brittle, and I didn't like it - but I couldn't see a nice pattern in the basic machine set-up to decide which one to use.
Today I decided to find out, so I made a matrix of all the machines, their architecture, OS version, and name, and then looked at the perl builds available to them. Turns out that there is a pattern, but it was obscured by the fact that not all versions of perl were available on all machines. I was able to create a solid filter based on the machine architecture (x86_64 or not) and then have a primary and a back-up.
It wasn't rocket science, but then again, very few things are. But this was a fun little excursion into what was there and what pattern fit. Interesting stuff.