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

variable names in uninit warnings for maint?

Thread Next
Nicholas Clark
May 24, 2004 13:10
variable names in uninit warnings for maint?
Message ID:
I'm aware that Dave doesn't think it sane to apply his variable naming patch
to maint as is:

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 holds,
   and is documented as doing exactly this


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 Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About