Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Your question is broader than Perl version: one also needs to choose what environments the code should work in. You may choose, for example, to target *nix and Windows only, so as to simplify the code (e.g. can use / as path separator without going to the bother of hauling in File::Spec).

My biggest beef is that many authors seem to not consciously, explicitly and clearly state their module's version and environment requirements in the module's documentation. In addition to the documentation, they should enforce it programmatically -- with require 5.005_03, for example.

Which Perl version and environment to target depends largely on the type of module. For example:

  • At work, where I can precisely control the Perl environment, I generally target perl 5.8.7+, *nix and Windows only. That allows me to learn and leverage the latest Perl features and simplify the code.
  • For CPAN modules, it's different. Modules that are expected to be needed in a broad variety of environments, such as Test::More, should target pre-historic Perl versions and all Perl environments. "Developer" modules, on the other hand, such as Devel::Cover, may reasonably choose to target only recent perl versions. You need to decide who the target users of the module are and whether it's reasonable to ask them to upgrade to a later perl version in order to use your module.

Update: As for testing for backwards compatibility, I install a standard perl 5.005, perl 5.6, perl 5.8 on my development system (with no extra modules). Then, before uploading my CPAN module, I run a little script to unpack the tarball and run "make test" against all these versions. More elaborate automated schemes are obviously possible, but this straightforward test should catch most backward compatibility (and dependency) blunders before you upload the module.


In reply to Re: Writing for backwards compatibility by eyepopslikeamosquito
in thread Writing for backwards compatibility by xdg

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • 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> <u> <ul>
  • 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 intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2024-04-25 16:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found