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

EXPORT and is export behave differently with dynamic variables #6433

Open
p6rt opened this issue Aug 16, 2017 · 1 comment
Open

EXPORT and is export behave differently with dynamic variables #6433

p6rt opened this issue Aug 16, 2017 · 1 comment

Comments

@p6rt
Copy link

p6rt commented Aug 16, 2017

Migrated from rt.perl.org#131913 (status was 'new')

Searchable as RT131913$

@p6rt
Copy link
Author

p6rt commented Aug 16, 2017

From @bduggan

If I have these three files​:

  # test.p6
  use lib '.';
  use first;
  say $foo;

  # first.pm6
  use second;
  sub EXPORT {
  return { '$foo' => $foo }
  }

  # second.pm6
  sub EXPORT {
  return { '$foo' => %*ENV<SETME> }
  }

and I say

  $ SETME=bar perl6 test.p6

I then get (as I expect)​:
 
  bar

But, if I run it again with SETME as something else​:

  $ SETME=baz perl6 test.p6

I still get

  bar

Replacing the EXPORT sub with

  our $foo is export = %*ENV<SETME>

gives me what I expect (the current value of SETME).

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

No branches or pull requests

1 participant