Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to get environment variables?

20 views
Skip to first unread message

Andy

unread,
Nov 2, 2003, 10:17:50 AM11/2/03
to
Would you pleas to tell if it is possible to get environment variables
from perl6 programme? It failes when I try to use perl5 hash %ENV.

Andy

unread,
Nov 2, 2003, 10:19:45 AM11/2/03
to

Andrew Shitov

unread,
Nov 3, 2003, 3:30:07 AM11/3/03
to perl6-l...@perl.org
Is it possible to get environment variables from perl6 programme? It
failes when I try to use perl5 hash %ENV. Thanks.

Simon Cozens

unread,
Nov 3, 2003, 9:56:20 AM11/3/03
to perl6-l...@perl.org
an...@shitov.ru (Andrew Shitov) writes:
> Is it possible to get environment variables from perl6 programme? It
> failes when I try to use perl5 hash %ENV. Thanks.

Are you sure you're using the Perl 6 hash syntax? (%ENV{FOO} rather than Perl
5-style $ENV{FOO})

What version of Perl 6 are you using?

--
"The C Programming Language -- A language which combines the power of
assembly language with the flexibility of assembly language."

Andrew Shitov

unread,
Nov 3, 2003, 12:24:17 PM11/3/03
to perl6-l...@perl.org
I tried this one-line programme for example:

my %e = %ENV;

and got this (parrot-0.0.13/perl are built under mandrake linux):

Global '_HV_ENV' not found
Error: '/parrot-0.0.13/parrot -r env.imc ' failed with exit code 1
Stopped at /parrot-0.0.13/languages/perl6/perl6 line 339
main::mydie(256,'/parrot-0.0.13/parrot -r env.imc ') called at
/parrot-0.0.13/languages/perl6/perl6 line 819
main::pass4('env.imc','env.warn') called at
/parrot-0.0.13/languages/perl6/perl6 line 741
main::pass2('env.imc','env.warn') called at
/parrot-0.0.13/languages/perl6/perl6 line 435
main::output_tree('P6C::prog=ARRAY(0x8ef6e5c)','env.p6','env.warn')
called at /parrot-0.0.13/languages/perl6/perl6 line 500
main::pass1('Parse::RecDescent=HASH(0x8f2ed70)','env.p6','env.warn','undef') called at /parrot-0.0.13/languages/perl6/perl6 line 562
main::run() called at /parrot-0.0.13/languages/perl6/perl6 line 219

0 new messages