http://www.perlmonks.org?node_id=11105684


in reply to Re^2: Minor API changes in 10-year-old module
in thread Minor API changes in 10-year-old module

Well, you can. It's more work but you could make this first new version behave like the old version, with aformentioned warnings, but also support the fixed API when they use it with use Module qw(:always-die); or use Module qw(:newapi); or whatever. Then your next version can switch to new api and silently ignore that flag.


holli

You can lead your users to water, but alas, you cannot drown them.

Replies are listed 'Best First'.
Re^4: Minor API changes in 10-year-old module
by Tux (Canon) on Sep 06, 2019 at 10:28 UTC

    If the new API is (clearly) better, I'd reverse that and add use Some::Module qw( API2009 ); and have a few wrapper functions that are backward compatible. The docs can then say that this possibility will be removed in version x.yy or from 2020-09-10 forward.

    As a side note: there is absolutely no need for a return immediately following a croak. The croak will exit the current scope immediately causing the return to never execute. Code like that is misleading and wrong.


    Enjoy, Have FUN! H.Merijn