develooper Front page | perl.perl5.porters | Postings from May 2004

variable names in uninit warnings for maint?

Thread Next
From:
Nicholas Clark
Date:
May 24, 2004 13:10
Subject:
variable names in uninit warnings for maint?
Message ID:
20040524161941.GG1383@plum.flirble.org
I'm aware that Dave doesn't think it sane to apply his variable naming patch
to maint as is:

http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2004-04/msg00777.html

and I now agree with his reasoning. I'm not convinced that if we made it
optional (but not default) that no-one would use it - the comment of people
at the Austrian Perl Workshop was that this would be a really useful feature,
and that they'd use it, if it were available.

However, the thread died out without any suggestions on how to do this.
I don't fully understand the warnings pragma, but as far as I can tell

1: use warnings; turns on all classes of warnings that warnings.pm holds,
   and is documented as doing exactly this

therefore 

2: if we were to make named uninit a class of warnings, even if it were not
   turned on by -w, it would have to be turned on by use warnings; and in
   turn that could break existing code

so it seems that

3: we need another way of specifying that we'd like uninit warnings to be
   reported in the new format.

which sort of comes down to should the change be lexical, or global.
I'd actually be quite happy with global (so please suggest arguments
against this) as I'm assuming that this would only be used by main programs,
and existing test suites are main programs that don't turn this on.

(ie programmers would have to turn this on by themselves, so they'd be
aware that they needed to take precautions to ensure that their foot was
safely elsewhere before pulling this trigger, and any module writer who
turns this on for the rest of the program is as anti-social as anyone
modifying an existing global)


What do people think?

Nicholas Clark

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About