On Mon, 13 Feb 2017 14:38:03 -0800, na...@cpan.org wrote:
> $ echo %windir%
> C:\WINDOWS
> 
> $ echo %WINDIR%
> C:\WINDOWS
> 
> $ c:\opt\perl6-mingw\bin\perl6 -e "say %*ENV<WINDIR>"
> (Any)
> 
> $ c:\opt\perl6-mingw\bin\perl6 -e "say %*ENV<windir>"
> C:\WINDOWS
> 
> $ c:\opt\perl6-mingw\bin\perl6 -v
> This is Rakudo version 2017.01 built on MoarVM version 2017.01
> implementing Perl 6.c.
> 
> Both %*ENV<WINDIR> and %*ENV<windir> (as well as, e.g., %*ENV<WinDir>
> etc) should return 'C:\WINDOWS'.
> 
> -- Sinan

What would be a good approach? Store them in whatever case they come in, but 
apply fc() when looking up keys?

If I dump all the vars with `set` I see all-uppercase, mixed-case, and 
all-lowercase vars. Perl 5 seems to uppercase them all (when I dump %ENV with 
Data::Dumper). And that naturally leads to what to do with stuff like 'ß', 
which Perl 5 dumps out to me as `'▀' => '42',`

---

I'm thinking of just sticking a subclass of Hash to %*ENV on Windows, something 
along the lines of

    $ perl6 -e 'my %h := class :: is Hash { method AT-KEY ($k) { nextwith $k.fc 
}; method ASSIGN-KEY ($k, $v) { nextwith $k.fc, $v } }.new; %h<Foo> = 42; dd 
%h; dd %h<foo>'

    {:foo(42)}
    Int <element> = 42

Reply via email to