Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Andy Haupt
March 24, 2005, 4:24 pm
rate this thread
Re: how do I access ksh environment array variables in perl?
Andy Haupt wrote:
> in ksh you can set array variables like
> and access them like
> echo $
> how do I access this array in Perl?
You don't. Array variables are Korn Shell specific;
they can only be set and accessed from the Korn shell.
If you leave ksh, the only thing accessible is the
first element of the array under the name of the array.
> $ENV retrieves 'x' (the value of a)
> keys %ENV lists 'a' amongst its vars
Correct. You have access to the first element of the
array, which gets listed under the name of the array.
> but how do I
> find out that a is an array, the length of a and its
> subscripts and values?
You don't, because you can't. Once you leave the
Korn Shell, you lose all your arrays. Perl doesn't
"Which one you figure tracked us?"
"The ugly one, sir."
"...Could you be more specific?"
- » FAQ 9.10 How do I decode or create those %-encodings on the web?
- — Previous thread in » PERL Discussions