develooper Front page | perl.perl6.language | Postings from March 2005

Re: Unknown level of hash

Thread Previous
Uri Guttman
March 28, 2005 15:43
Re: Unknown level of hash
Message ID:
>>>>> "ZL" == Zhuang Li <> 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 Guttman  ------  --------
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------

Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About