develooper Front page | perl.perl5.porters | Postings from January 2012

Re: How we deprecate (was Re: Deprecating '\w {' in v5.16)

Thread Previous | Thread Next
January 30, 2012 04:02
Re: How we deprecate (was Re: Deprecating '\w {' in v5.16)
Message ID:
On 30 January 2012 12:51, David Golden <> wrote:
> On Mon, Jan 30, 2012 at 5:33 AM, demerphq <> wrote:
>> I personally think that deprecation warnings would be a lot easier to
>> add, and a lot less painful,  if they were warn-first-use, instead of
>> the normal warn-every-use.
>    use less 'warnings';  # :-)
> Serious note -- this seems like it should be a user option, not a
> default, if implemented.  Are we out of command-line flags?  (Would -X
> already suffice for this?)  I note that "-q" (quiet) is available.

I dont think it should be a user option. I think it should be the
default behavior for deprecation warnings. It does not add value to
repeatedly tell someone that the code is deprecated every time they
use a deprecated feature. After all the code is NOT misbehaving, it
simply will no longer work in a later release. This is quite different
from telling them that their code might be silently doing something
different than they think, which is why we normally warn every use.

Also, your joke actually demonstrates why this should not be an
option: It wouldn't actually help as you would have to enable it in
every module which uses deprecated features. So it need to be a global
flag. Even then, there will be many users that cannot set it one way
or another.  So IMO it should just be default behaviour.

Lets not forget that we are piggy  backing deprecation notifications
on top of a system that was designed for other purposes. As  such I
think it is appropriate to change the behavior.


perl -Mre=debug -e "/just|another|perl|hacker/"

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About