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

Re: Unknown level of hash

Thread Previous
From:
Uri Guttman
Date:
March 28, 2005 15:43
Subject:
Re: Unknown level of hash
Message ID:
x71x9z9w0q.fsf@mail.sysarch.com
>>>>> "ZL" == Zhuang Li <zli@valueclick.com> 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  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About