I know this is kind of an old thread, but I was wondering if anyone has any code that will recursively go through a directory structure and find ALL the PERL modules and then print out the version. My Red Hat Linux distro has /usr/local/lib/perl5 and then the sub-dirs 5.8.5 and site_perl. How would I sweep through these two sub-dirs, find all the .pm files, for example, and then have it give me the VERSION if a VERSION variable exist in the .pm file? The reason I ask is I have 4 machines which I must compare VERSIONs on. So if I can get the output into 4 individual files I can easily import the data into a spreadsheet and compare. I have a small bash script that seems to work, but I'm looking for an efficient PERL method. I am just learning PERL i.e. I'm a few pages into the 5th ED. of the O'Reilly book, so the coding required is still a bit over my head, yet I have this task to complete for the boss man. Any help you can offer would be greatly appreciated.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
Outside of code tags, you may need to use entities for some characters:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||