Skip to content
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

%*ENV doesn't work from within a use'd module in Rakudo #2213

Closed
p6rt opened this issue Oct 6, 2010 · 5 comments
Closed

%*ENV doesn't work from within a use'd module in Rakudo #2213

p6rt opened this issue Oct 6, 2010 · 5 comments

Comments

@p6rt
Copy link

p6rt commented Oct 6, 2010

Migrated from rt.perl.org#78258 (status was 'resolved')

Searchable as RT78258$

@p6rt
Copy link
Author

p6rt commented Oct 6, 2010

From @masak

mberends++ reports the following bug​:

$ cat testenv.pm6

print 'Test existence of %*ENV<PERL6LIB>​: ';
print %*ENV.exists('PERL6LIB');
say " OK, still alive";

$ rakudo testenv.pm6

Test existence of %*ENV<PERL6LIB>​: Bool​::True OK, still alive

$ rakudo -e 'use testenv'

Test existence of %*ENV<PERL6LIB>​: Method 'exists' not found for
invocant of class 'Failure'
  in main program body at line 2​:testlib.pm6

...

In other words, %*ENV doesn't exist early enough for it to work within
a use'd module.

@p6rt
Copy link
Author

p6rt commented May 28, 2012

From @coke

On Wed Oct 06 16​:01​:03 2010, masak wrote​:

mberends++ reports the following bug​:

$ cat testenv.pm6

print 'Test existence of %*ENV<PERL6LIB>​: ';
print %*ENV.exists('PERL6LIB');
say " OK, still alive";

$ rakudo testenv.pm6

Test existence of %*ENV<PERL6LIB>​: Bool​::True OK, still alive

$ rakudo -e 'use testenv'

Test existence of %*ENV<PERL6LIB>​: Method 'exists' not found for
invocant of class 'Failure'
in main program body at line 2​:testlib.pm6

...

In other words, %*ENV doesn't exist early enough for it to work within
a use'd module.

This works now​:

$ PERL6LIB=masak ./perl6 testenv.pm6
Test existence of %*ENV<PERL6LIB>​: True OK, still alive
$ PERL6LIB=masak ./perl6 -I. -e "use testenv"
Test existence of %*ENV<PERL6LIB>​: True OK, still alive

Closable with tests.

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented May 28, 2012

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Jan 14, 2014

From @coke

On Sun May 27 20​:11​:51 2012, coke wrote​:

On Wed Oct 06 16​:01​:03 2010, masak wrote​:

mberends++ reports the following bug​:

$ cat testenv.pm6

print 'Test existence of %*ENV<PERL6LIB>​: ';
print %*ENV.exists('PERL6LIB');
say " OK, still alive";

$ rakudo testenv.pm6

Test existence of %*ENV<PERL6LIB>​: Bool​::True OK, still alive

$ rakudo -e 'use testenv'

Test existence of %*ENV<PERL6LIB>​: Method 'exists' not found for
invocant of class 'Failure'
in main program body at line 2​:testlib.pm6

...

In other words, %*ENV doesn't exist early enough for it to work within
a use'd module.

This works now​:

$ PERL6LIB=masak ./perl6 testenv.pm6
Test existence of %*ENV<PERL6LIB>​: True OK, still alive
$ PERL6LIB=masak ./perl6 -I. -e "use testenv"
Test existence of %*ENV<PERL6LIB>​: True OK, still alive

Closable with tests.

Test was added to S02-magicals/78258.t by Steve Mynott in 08/2013, but was never activated. as of 536cb03, rakudo is now running (and at least on parrot, passing) this test.

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Jan 14, 2014

@coke - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant