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
our sub Foo::Bar spits a different error message from the one for my sub Foo::Bar #16058
Comments
From ishigaki@cpan.orgCreated by ishigaki@cpan.orgour sub Foo::Bar spits a different error message from the one for See the following examples: $ perl -E 'my sub Foo::Bar {}' $ perl -E 'state sub Foo::Bar {}' $ perl -E 'our sub Foo::Bar {}' Perl Info
|
From @cpansproutOn Fri, 30 Jun 2017 00:38:00 -0700, ishigaki wrote:
That it says ‘variable’, not ‘subroutine’, is a bug. That is emits a different message is longstanding behaviour, based on variables: $ perl -e 'my $foo::bar' I think the difference is due to the fact that ‘our’ variables do reside in a package; they just cannot be declared that way. -- Father Chrysostomos |
The RT System itself - Status changed from 'new' to 'open' |
From @demerphqOn 30 Jun 2017 15:18, "Father Chrysostomos via RT" < On Fri, 30 Jun 2017 00:38:00 -0700, ishigaki wrote:
That it says ‘variable’, not ‘subroutine’, is a bug. That is emits a $ perl -e 'my $foo::bar' I think the difference is due to the fact that ‘our’ variables do reside in It doesn't make sense to use our with a fully qualified var; what would it Yves |
From ishigaki@cpan.orgOn Fri, 30 Jun 2017 06:31:26 -0700, demerphq wrote:
I wrote it out of mere curiosity while I was checking what lexical subs could do and could not do, to prepare for a talk I gave at YAPC::Japan this morning: "my sub ok" can be used, for example, to monkey-patch "ok" imported from Test::More only in some block and without disabling warnings. Let's see, then, if it can also be used to monkey-patch Test::More::ok itself. Of course not. Then what happens if I change "my" to something else, and oh... So, I also don't know what it should mean. However, I was surprised when I saw the word "variable" while testing lexical subroutine, hence the report.
|
From @cpansproutOn Fri, 30 Jun 2017 23:42:27 -0700, ishigaki wrote:
This is now fixed in commit b9a58d5. -- Father Chrysostomos |
@cpansprout - Status changed from 'open' to 'pending release' |
From @khwilliamsonThank you for filing this report. You have helped make Perl better. With the release yesterday of Perl 5.28.0, this and 185 other issues have been Perl 5.28.0 may be downloaded via: If you find that the problem persists, feel free to reopen this ticket. |
@khwilliamson - Status changed from 'pending release' to 'resolved' |
Migrated from rt.perl.org#131679 (status was 'resolved')
Searchable as RT131679$
The text was updated successfully, but these errors were encountered: