> "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
...->{En}->{K2} = 'V2';
$hash->{E1}->...->{En}->{Km} = 'Vm';
john
> -Original Message-
> From: Jeff Yoak [mailto:[EMAIL PROTECTED]
> Sent: Monday, March 28, 2005 3:40 PM
> To: Zhuang Li
> Cc: fwp@perl.org
> Subject: Re: Unknown leve
Zhuang Li wrote:
Yes. I think it's both useful and fun. I was thinking something similar
to
@[EMAIL PROTECTED] = map{1} @a;
But getting "$hash->{E1}->{E2}->...->{En} = 1;" instead of "$hash{E1} =
1; ... $hash{En} =1;".
What I'd really like to do is:
Given @a = ('E1', 'E2', ..., 'En');
@b
Zhuang Li writes:
> Yes. I think it's both useful and fun. I was thinking something similar
> to
> @[EMAIL PROTECTED] = map{1} @a;
>
> But getting "$hash->{E1}->{E2}->...->{En} = 1;" instead of "$hash{E1} =
> 1; ... $hash{En} =1;".
Yeah, like this:
%hash{dims @a} = (1) xx Inf;
> What I'd r
> -Original Message-
> From: Luke Palmer [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, March 29, 2005 5:43 AM
> To: Zhuang Li
> Cc: Jeff Yoak; fwp@perl.org; perl6-language@perl.org
> Subject: Re: Unknown level of hash
>
> Zhuang Li writes:
> > Yes. I think i