# New Ticket Created by  k...@mib.org 
# Please include the string:  [perl #80450]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=80450 >


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) k...@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"

Reply via email to