Re: Unknown level of hash

Uri Guttman <[email protected]>
Newsgroups gmane.comp.lang.perl.fun,gmane.comp.lang.perl.perl6.language
Message-ID <[email protected]>
>>>>> "ZL" == Zhuang Li <[email protected]> writes:

  ZL> Hi, given an array: @a = ('E1', 'E2', ..., 'En'); 
  ZL> Is there an easy way, hopefully one liner, to do the following without a
  ZL> loop? If not, will Perl support this in Perl 6?


  ZL> $hash->{E1}->{E2}->...->{En} = 1;

i think perl6 plans to have a way to do this. there is a dim operator to
set dimensions. so it would be something like this:

	%hash{ dim @a }

or is $hash has a hash ref:

	$hash{ dim @a }

i cc'ed p6l so i can/will be corrected.

uri

-- 
Uri Guttman  ------  [email protected]  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.