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

Re: [perl #22291] 5.8.x: no warnings "redefine" doesn't affect constant subs

Thread Previous | Thread Next
From:
Slaven Rezic
Date:
May 23, 2003 12:26
Subject:
Re: [perl #22291] 5.8.x: no warnings "redefine" doesn't affect constant subs
Message ID:
87vfw1lb3x.fsf@vran.herceg.de
Stas Bekman (via RT) <perlbug-followup@perl.org> writes:

> # New Ticket Created by  Stas Bekman 
> # Please include the string:  [perl #22291]
> # in the subject line of all future correspondence about this issue. 
> # <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=22291 >
> 
> 
> This is a bug report for perl from stas@hope.stason.org,
> generated with the help of perlbug 1.34 running under perl v5.8.1.
> 
> -----------------------------------------------------------------
> [Please enter your report here]
> 
>   % perl-5.6.1 -le' use warnings; use constant FOO => 1; \
>     no warnings "redefine"; use constant FOO => 2;'
> 
> no output, good!
> 
>    % perl-5.8.1 -le' use warnings; use constant FOO => 1; \
>      no warnings "redefine"; use constant FOO => 2;'
> Constant subroutine main::FOO redefined at
> /home/stas/perl/5.8.1/lib/5.8.1/constant.pm line 108.
> 
> you can't turn this one off even with $^W=0; the problem exists in 5.8.0
> and blead-perl.
> 

This seems to be intended --- this comment is in sv.c:

 				/* Redefining a sub - warning is mandatory if
 				   it was a const and its value changed. */

Maybe the warning message should be tweaked.

Regards,
	Slaven

-- 
Slaven Rezic - slaven@rezic.de

    Berlin Perl Mongers - http://berliner.pm.org

Thread Previous | 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