Re: How to read a particular environmental variable?

2020-04-08 Thread ToddAndMargo via perl6-users
On 2020-04-08 19:46, ToddAndMargo via perl6-users wrote: And %*ENV    raku -e "say %*ENV;" (Any) My bad: %windir% is lower case raku -e "say %*ENV;" C:\WINDOWS Trait:Env still does not work: raku -e "use Trait::Env; my $windir is env; say $windir;" (Any)

Re: How to read a particular environmental variable?

2020-04-08 Thread ToddAndMargo via perl6-users
On 2020-04-07 23:56, Simon Proctor wrote: > You might want to take a look at Trait::Env, partly because I've not > tested it in Windows and I'd be interested to know if it works well. https://modules.raku.org/dist/Trait::Env:cpan:SCIMON On Wed, 8 Apr 2020 at 09:22,

Re: How to read a particular environmental variable?

2020-04-08 Thread ToddAndMargo via perl6-users
On 2020-04-07 23:56, Simon Proctor wrote: > You might want to take a look at Trait::Env, partly because I've not > tested it in Windows and I'd be interested to know if it works well. https://modules.raku.org/dist/Trait::Env:cpan:SCIMON > On Wed, 8 Apr 2020 at 09:22,

Re: How to read a particular environmental variable?

2020-04-08 Thread Simon Proctor
Well he is me so let my try and explain. The idea is to be able to simply assign Env vars to variables so for example you might do use Trait::Env; my $windir is env; And then $windir should be assigned the value of the %*ENV variable at runtime. There's a bunch of other stuff in it too, it's

Re: How to read a particular environmental variable?

2020-04-08 Thread ToddAndMargo via perl6-users
On Wed, 8 Apr 2020, 03:25 ToddAndMargo via perl6-users, mailto:perl6-users@perl.org>> wrote: On 2020-04-07 18:25, Brad Gilbert wrote: > Of course %*ENV is case sensitive, hashes are case sensitive. > > say %*ENV.^name; # Hash > > %*ENV gets populated with the

Re: How to read a particular environmental variable?

2020-04-08 Thread Simon Proctor
You might want to take a look at Trait::Env, partly because I've not tested it in Windows and I'd be interested to know if it works well. On Wed, 8 Apr 2020, 03:25 ToddAndMargo via perl6-users, < perl6-users@perl.org> wrote: > On 2020-04-07 18:25, Brad Gilbert wrote: > > Of course %*ENV is case

Re: How to read a particular environmental variable?

2020-04-07 Thread ToddAndMargo via perl6-users
On 2020-04-07 18:25, Brad Gilbert wrote: Of course %*ENV is case sensitive, hashes are case sensitive.     say %*ENV.^name; # Hash %*ENV gets populated with the values before your code runs. Other than that it is fairly ordinary. My purpose for the case sensitive remark was that

Re: How to read a particular environmental variable?

2020-04-07 Thread Brad Gilbert
Of course %*ENV is case sensitive, hashes are case sensitive. say %*ENV.^name; # Hash %*ENV gets populated with the values before your code runs. Other than that it is fairly ordinary. On Tue, Apr 7, 2020 at 7:20 PM ToddAndMargo via perl6-users < perl6-users@perl.org> wrote: > >> On Tue,

Re: How to read a particular environmental variable?

2020-04-07 Thread ToddAndMargo via perl6-users
On Tue, Apr 7, 2020 at 6:48 PM ToddAndMargo via perl6-users mailto:perl6-users@perl.org>> wrote: Hi All, $ raku -e 'say %*ENV;' Gives me ALL of them. Is there a way to just ask for a particular one, such as %appdata%, or %userprofile% in Windows or $HOME is Linux?

Re: How to read a particular environmental variable?

2020-04-07 Thread Gerard ONeill
It’s still a hash — the * twigil tweaks it’s scope, but it is still a % — so %*ENV works (windows) On Tue, Apr 7, 2020 at 6:48 PM ToddAndMargo via perl6-users < perl6-users@perl.org> wrote: > Hi All, > > $ raku -e 'say %*ENV;' > > Gives me ALL of them. Is there a way to just ask for > a

How to read a particular environmental variable?

2020-04-07 Thread ToddAndMargo via perl6-users
Hi All, $ raku -e 'say %*ENV;' Gives me ALL of them. Is there a way to just ask for a particular one, such as %appdata%, or %userprofile% in Windows or $HOME is Linux? Many thanks, -T