Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Help with making a Module to reveal supported Perl versions

by taint (Chaplain)
on Dec 11, 2013 at 19:28 UTC ( #1066688=perlquestion: print w/ replies, xml ) Need Help??
taint has asked for the wisdom of the Perl Monks concerning the following question:

Greetings Monks,

<prolog> I was faced with the inability to use my dev box to test a Perl Module destined for the CPAN. As it was updating portions of the OS it runs on. So in an effort to run preliminary tests on the Module. I was forced to attempt to emulate a Perl 5.6 scope of tests. As I didn't want to modify, or install other Perls on the box I was testing the Module on. The whole thing was an unpleasant experience. Which, to me, seemed unnecessarily difficult. Then I had this thought, that surely there is a Module that I could (use|require), that would tell me which functions, etc.. in which versions (of Perl) My Module supports. After searching much of last night. I was unable to find anything that "fit the bill".</prolog>

So. I decided to embark on the creation of a Module that; once used/required will reveal just how old/low a version the Module you are creating will/would support. While I have my ideas on how this might be best accomplished. I thought before I got too far into it, that I should inquire as to whether this has already been done, and I didn't find it. Also, how others feel this should be best done -- if at all.

The specific question I have right now is; how can I best get the internal functions provided by any particular version of Perl, and their specific names? I'm attempting to get it from source. I've got every version from present, to 5.6.0. All unpacked.

Apologies for the long prolog. But I couldn't think of a better/more concise way to introduce/justify the whole endevour.

All the best

--Chris

Yes. What say about me, is true.

Comment on Help with making a Module to reveal supported Perl versions
Re: Help with making a Module to reveal supported Perl versions
by davido (Archbishop) on Dec 11, 2013 at 19:45 UTC

    Did you see, in your "searching much of last night", Perl::MinimumVersion, and perlver?

    The quest you're embarking upon is difficult. If your new module is to provide some functionality not present in Perl::MinimumVersion, you might at least start by building upon the shoulders of that giant.

    And if you did find that module last night, perhaps you could elaborate on how it fails to meet your needs. Then we would at least better understand the context under which you're forging a new tool.


    Dave

      Thank you, davido! No, I didn't see Perl::MinimumVersion. While I haven't yet thoroughly examined it. It does seem to "fit the bill". Should I find something missing. I would surely simply attempt to add to it (by building upon the shoulders of that giant). :)

      Thank you very much davido, for the excellent link. Much appreciated.
      I can't believe I missed it. <blush>

      --Chris

      Yes. What say about me, is true.
      
        Update:

        OK. I've had a bit of time to examine it (Perl::MinimumVersion) enough to evaluate to my perceived needs regarding the Module I had intended to create. Specifically; it lacks the ability to cross-reference calls/functions imported/exported by other Modules that your Module (uses|requires). It's difficult. Because, as I found last night File::Path is effectively in Perl. But the exports are different. For example. File::Path qw(make_path); was introduced in 5.8. But in order to achieve the same results in earlier versions. I discovered the export had to be File::Path qw(mkpath);. This would also work in versions newer than 5.6. But, being "legacy", will throw warnings during the "smoketest" cycle(s) on the CPAN.

        So. Perhaps my well-intentioned endevour is still valid. But would be better directed at an extension the the already existent Perl::MinimumVersion.

        Thanks again for your input.

        --Chris

        Yes. What say about me, is true.
        
      The source seems to stop at 5.12. Lot of new stuff since then to add...
      لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

        Maybe it's a candidate for adoption. There are a number of open reports. Nevertheless, it makes more sense to bring it up to speed than to start from scratch.


        Dave

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1066688]
Approved by Old_Gray_Bear
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (17)
As of 2014-07-28 18:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (205 votes), past polls