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 really like to do is:
> 
> Given @a = ('E1', 'E2', ..., 'En');
>       @b = ('K1', 'K2', ..., 'Km');
>       @c = ('V1', 'V2', ..., 'Vm');
> 
> To get the following in one line:
> $hash->{E1}->...->{En}->{K1} = 'V1';
> $hash->{E1}->...->{En}->{K2} = 'V2';
> ....
> $hash->{E1}->...->{En}->{Km} = 'Vm';

    %hash{dims @[EMAIL PROTECTED] = @c;

Were you asking the right thing?

Luke

Reply via email to