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 : "Method 'key' not found for invocant of class 'String' #2289

Closed
p6rt opened this issue Dec 9, 2010 · 4 comments
Closed

%*ENV : "Method 'key' not found for invocant of class 'String' #2289

p6rt opened this issue Dec 9, 2010 · 4 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Dec 9, 2010

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

Searchable as RT80450$

@p6rt
Copy link
Author

p6rt commented Dec 9, 2010

From kst@mib.org

It appears that Rakudo Star 2010.11 mishandles the %*ENV hash.
(Either that, or I'm just misunderstanding how it's supposed to work.)

I installed Rakudo Star 2010.11 from source (rakudo-star-2010.11.tar.gz)
on Ubuntu 9.04. In the following, the error messages produced by
"perl6 --version" are also a bit disturbing.

I expected​:
  say "%*ENV = ", %*ENV.kv.perl;
to print the values of all my current environment variables.

================================================================
% perl6 --version

This is Rakudo Perl 6, version 2010.11 built on parrot 2.10.1Null PMC access in get_bool()
current instr.​: 'perl6;Perl6;Compiler;version' pc 326465 (src/gen/perl6-grammar.pir​:16967)
called from Sub 'perl6;PCT;HLLCompiler;command_line' pc 1855 (compilers/pct/src/PCT/HLLCompiler.pir​:917)
called from Sub 'perl6;Perl6;Compiler;main' pc 326404 (src/gen/perl6-grammar.pir​:16945)
% cat env-bug
#!/usr/local/bin/perl6

my %my_env = ('FOO' => 'foo', 'BAR' => 'bar'); # ok

say "\%*ENV<TERM> = \"%*ENV<TERM>\""; # ok
say "\%my_env<FOO> = \"%my_env<FOO>\""; # ok

say "%my_env = ", %my_env.kv.perl; # ok
say "%*ENV = ", %*ENV.kv.perl; # KABOOM
% ./env-bug
%*ENV<TERM> = "xterm"
%my_env<FOO> = "foo"
%my_env = ("FOO", "foo", "BAR", "bar")
Method 'key' not found for invocant of class 'String'
  in <anon> at line 5042​:CORE.setting
  in 'Any​::join' at line 1
  in 'List​::perl' at line 2696​:CORE.setting
  in main program body at line 9​:./env-bug

Some other things that don't work as I expected​:

my %my_env = %*ENV
Method 'key' not found for invocant of class 'String'
%*ENV<TERM> = 'vt100'
Cannot modify readonly value

--
Keith Thompson (The_Other_Keith) kst@​mib.org <http://www.ghoti.net/~kst>
Working, but not speaking, for Nokia
"We must do something. This is something. Therefore, we must do this."
  -- Antony Jay and Jonathan Lynn, "Yes Minister"

@p6rt
Copy link
Author

p6rt commented Nov 20, 2012

From @FROGGS

looks good today​:

<FROGGS> r​: say "%*ENV = ", %*ENV.kv.perl;
<p6eval> rakudo bf472b​: OUTPUT«%*ENV = (("PERLBREW_VERSION", "0.42"),
("MAIL", "/var/mail/p6eval"), ("USER", "p6eval"), ("SHLVL", "1"),
("HOME", "/home/p6eval"), ("OLDPWD", "/home/p6eval"), ("PERLBREW_ROOT",
"/home/p6eval/perl5/perlbrew"), ("PERLBREW_MANPATH",
"/home/p6eval/perl5/perlbrew/perls/…
<FROGGS> r​: my %my_env = %*ENV
<p6eval> rakudo bf472b​: ( no output )
<FROGGS> r​: %*ENV<TERM> = 'vt100'
<p6eval> rakudo bf472b​: ( no output )

@p6rt
Copy link
Author

p6rt commented Nov 20, 2012

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

@p6rt
Copy link
Author

p6rt commented Nov 7, 2013

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

@p6rt p6rt closed this as completed Nov 7, 2013
@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant