New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Empty Constants Called as Methods Return Package #7097
Comments
From root@.uucpCreated by root@(none).uucpGiven this one-liner: % perl -le 'use constant Foo => (); print __PACKAGE__->Foo;' Of course, it shouldn't output "main", it should output nothing. This Perl Info
|
From david@kineticode.comI've now run into this bug in two installations of Perl 5.8.1. One was Suse: Summary of my perl5 (revision 5.0 version 8 subversion 1) configuration: Panther: Summary of my perl5 (revision 5.0 version 8 subversion 1 RC3) Characteristics of this binary (from libperl): |
The RT System itself - Status changed from 'new' to 'open' |
From david@kineticode.comOn Feb 23, 2004, at 3:46 PM, Nicholas Clark wrote:
But thorough! I've changed my code from: use constant RO_FIELDS => (); to: use RO_FIELDS () { return } So that I should never see this problem again, anyway. Thanks for the history, Nick--very interesting! Regards, David |
From @nwc10On Tue, Feb 10, 2004 at 09:10:24PM -0000, none via RT wrote:
Thanks for this concise bug report.
Actually this isn't quite correct it does exist in 5.8.1, but not 5.8.0, On Mon, Feb 23, 2004 at 01:00:00PM -0800, David Wheeler wrote:
I guess that the bug relates to what the return value of an empty subroutine sub empty {} The default return from a subroutine is the last evaluated expression. Until recently what this means for an empty sub had not been thought about, Every perl version prior to 5.8.0 complied with this quite literally by After 5.8.1 was released we realised all this, consulted with Larry about Although 5.6.2 was released after 5.8.2 (and Larry's decision), 5.6.2 was This is rather a long explanation for a wonderfully terse report. Nicholas Clark |
@iabyn - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#26524 (status was 'resolved')
Searchable as RT26524$
The text was updated successfully, but these errors were encountered: