develooper Front page | perl.perl6.users | Postings from September 2018

I need hash syntax help

Thread Next
From:
ToddAndMargo
Date:
September 15, 2018 06:59
Subject:
I need hash syntax help
Message ID:
5b6ea0ce-d9c2-d45a-8f0b-bb729c6fb638@zoho.com
Hi All,

Why does `$y =%x<<$z>>` work in the following and
`$y =%x<$z>` and `$y =%x<"$z"> do not work?

$ p6 'my Str %x=("Jan"=>"01", "Feb"=>"02");
       my Str $z="Jan";
       my $y =%x<<$z>>;
       say "$y";'
01

Why did I get it right?


Many thanks,
-T

Thread Next


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