You can get rid of that humongous hash def and deal with different perl versions by using Module::CoreList
Actually, I tried that, and ran into a couple of problems with it:
- Module::CoreList is not installed by default on all systems. This would mean I would either have to include it in my code or have people download and install it -- which makes it less of the autonomous program I wanted it to be. (For instance, not everyone has the rights to install modules on their servers).
- Module::CoreList is incomplete. I don't know if it's because my version of Perl isn't supported or if I was using it wrong, but I got many of the Modules from perlmodlib in the output.
- Module::CoreList contains a big hash like the one right there, except mine worked for what was needed.
- I didn't need hashes of all the modules for all versions of perl. A hash of all of the modules was sufficient because if it was installed, 10 to 1 it came with Perl
- After playing around with it for a couple minutes, I figured it would be much quicker to create a macro in Emacs to grab the modules from perldoc perlmodlib, and it was.
- I also contemplated ripping modules from perldoc perlmodlib so that I would be sure of having the right modules for that particular version of Perl. I decided against it because that assumed that perldoc was installed, that the user had access rights to it, and that all perlmodlib pages were formatted a certain way (i.e. I'd have to do some debugging on different versions of Perl to be sure -- which seemed like more trouble then it was worth).
Want to support the EFF and FSF by buying cool stuff? Click here
Are you posting in the right place? Check out Where do I post X? to know for sure.
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
Want more info? How to link or
or How to display code and escape characters
are good places to start.