September 2013 Archives

Breaking users of old versions of a module

Suppose that for some reason you really, really need to introduce a silent, backward-incompatible change for a module. For example, in 0.03 and earlier foo() accepts ($a, $b) as arguments but you need to change it to ($b, $a). After releasing v0.04, you probably also want to break code that says any of the following:

use MyModule; # no version specified
use MyModule 0.01;
use MyModule 0.02;
use MyModule 0.03;

by, e.g., croaking with a message like "Order of arguments of foo() changed in 0.04, please use older vers…

About Steven Haryanto

user-pic A programmer (mostly Perl 5 nowadays). My CPAN ID: SHARYANTO. I'm sedusedan on perlmonks. My twitter is stevenharyanto (but I don't tweet much). Follow me on github: sharyanto.