On Mon, Jun 08, 2009 at 12:02:43PM +0100, Ville Koskinen wrote:
: An alternative is always
:
: @hash{qw(foo bar)} = ('some value') x 2;
:
: which is probably
:
: %hash = ('some value') x 2;
:
: in Perl 6, but you always need to take care to write the correct integer
: in the list replication.
2009/6/8 Ville Koskinen :
> Hello all,
>
> I was curious if this is possible in Perl 6:
>
> %hash{ 'foo' & 'bar' } = 'some value';
> # %hash{'foo'} eq 'some value' and %hash{'bar'} eq 'some value'
By autothreading, this would be equivalent to:
(%hash{'foo'} & %hash{'bar'}) = 'some value';
wh
Hello all,
I was curious if this is possible in Perl 6:
%hash{ 'foo' & 'bar' } = 'some value';
# %hash{'foo'} eq 'some value' and %hash{'bar'} eq 'some value'
or perhaps
%hash{ 'foo' | 'bar' } = 'some value';
In other words, is it possible to assign the same value to multiple hash
keys simulta