On Fri, Jul 17, 2009 at 18:50, Marc Chantreux<kha...@phear.org> wrote:
> hello,
>
> this is a simple code i wrote for test:
>
> -----
>
> my %foo = < a 12 b 34 c 45 >;
> my @a = < a >;
> my $c = 'c';
> say %foo.keys.join('/');  # b/c/a
> say @a[0];                # a
> say %foo<< @a[0] $c >>.join('/');
>
> -----
>
> on the last line, i expected: '12/45' but had
>
> # stdout: /45
> # stderr: Use of uninitialized value
>
> both rakudo and parrot where just upgraded. Did i make it wrong ?
>
> regards
> marc
>

It looks like array dereferencers don't interpolate currently in
double quotish strings, so you were trying to look up '@a[0]' in the
hash.  This is likely a bug a Rakudo.  I think S02 says that "@a[0]"
should be interpolated and that "@a[]" should be interpolate the way
"@a" does in Perl 5).  You can currently say

say %foo<< {...@a[0]} $c >>.join('/');

or

say %f...@a[0], $c}.join('/')

-- 
Chas. Owens
wonkden.net
The most important skill a programmer can have is the ability to read.

Reply via email to