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
Weird non-equivalence between $::{'a'} = sub {} and *::a = sub {} #9441
Comments
From @Drahflow-----BEGIN PGP SIGNED MESSAGE----- Testcase: #/usr/bin/perl use Carp; $::{'a'} = sub { print "a\n"; }; a(); eval "a()"; confess Output: a Plain English Version: Something odd is happening if a sub reference is assigned to a Also the oddness can be modified by calling the sub directly This difference might seem totally insignificant. If the names The documentation in "perlmod" seems to imply that the typeglob Best Regards, perlbug -d: - --- Configured by Debian Project at Mon Nov 12 17:04:39 UTC 2007. Summary of my perl5 (revision 5 version 8 subversion 8) configuration: Locally applied patches: - --- - --- iD8DBQFImVcOzhchXT4RR5ARArUwAKDZzuE4SYWfkzAjnzvBJoqpUsqFmQCgiEpX |
From p5p@spam.wizbit.beOn Wed Aug 06 00:47:57 2008, drahflow@gmx.de wrote:
Easier examples: $ perl -le '$main::{foo} = \"a"; eval "print \$foo;";' $ perl -wle '$main::{foo} = \"a"; eval "print \$foo;";$_=$foo;' $ perl -wle '*foo = \"a"; eval "print \$foo;";' Another example: $ cat rt-57646.pl $ perl -wle '$main::{foo} = \"a"; require "rt-57646.pl";' ('a' was 'exepected' instead of undef) $ perl -wle '$main::{foo} = \"a"; require "rt-57646.pl";$_=$foo;' This behaviour goes back to at least 5.00504. I vote to remove the line: It seems to me that explaining that it needs a reference to *foo which Patch that removes the text is attached. Kind regards, Bram |
The RT System itself - Status changed from 'new' to 'open' |
From @rgs2008/8/6 Bram via RT <perlbug-followup@perl.org>:
Thanks, applied as #34221. |
@rgs - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#57646 (status was 'resolved')
Searchable as RT57646$
The text was updated successfully, but these errors were encountered: