Do you know where your variables are? | |
PerlMonks |
Re: Writing for backwards compatibilityby eyepopslikeamosquito (Archbishop) |
on Nov 08, 2005 at 23:39 UTC ( [id://506938]=note: 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:
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 Section
Meditations
|
|