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
Perl spoils global namespace if module require FAIL #14914
Comments
From @KES777Created by @KES777my $pkg = 'Some::Pkg::'; doesn't exist The third message is unexpected Perl Info
|
1 similar comment
From @KES777Created by @KES777my $pkg = 'Some::Pkg::'; doesn't exist The third message is unexpected Perl Info
|
From @KES777my $name = 'Some::Pkg'; doesn't exist |
From zefram@fysh.orgKES wrote:
Don't even need that to make the glob appear. "require $name if 0" -zefram |
The RT System itself - Status changed from 'new' to 'open' |
From @jkeenanSuperseded by RT # 126077. |
The RT System itself - Status changed from 'new' to 'open' |
@jkeenan - Status changed from 'open' to 'rejected' |
From @nwc10On Wed, Sep 16, 2015 at 11:33:04PM -0700, KES wrote:
The third line has the same output in 5.001 (the oldest version that I have The first line prints "exists" in 5.001. I attempted to bisect when it changed, using ./Porting/bisect.pl --target=miniperl -e 'my $pkg = "Some::Pkg::"; if (!defined(*$pkg)) {die "does not exist"}' That narrows that behaviour change down to about 30 commits in Feb 1999 - So I *think* that this example hasn't changed behaviour in about 15 years. However, I don't know why a failed require does something that causes the Nicholas Clark |
From zefram@fysh.orgNicholas Clark wrote:
It doesn't. Parsing a bareword require does. -zefram |
From @nwc10On Thu, Sep 17, 2015 at 02:24:44PM +0100, Zefram wrote:
Yes, I've just realised that I missed your comment earlier, as it hadn't hit I'd forgotten about bareword requires. IIRC the implementation details of Nicholas Clark |
From @KES777I faced this problem when trying to speedup checking the module have loaded. I did this: my return eval "require $full_name; 1"; And here if we try to load 'Not::Exists' first time - it is OK. But next time it says that module is loaded but actually it is not. |
From @ikegamiSimply referencing a package creates it. It's got nothing to do with $ perl -E'$pkg="Some::Pkg::"; say defined(*$pkg)?1:0; eval "*$pkg"; say On Thu, Sep 17, 2015 at 2:33 AM, KES <perlbug-followup@perl.org> wrote:
|
@iabyn - Status changed from 'open' to 'rejected' |
Migrated from rt.perl.org#126077 (status was 'rejected')
Searchable as RT126077$
The text was updated successfully, but these errors were encountered: