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

how do I assign an array to a hash key

Thread Next
From:
ToddAndMargo
Date:
September 29, 2017 04:32
Subject:
how do I assign an array to a hash key
Message ID:
dd99d912-9bbe-7a95-ad9f-f87ec5606d45@zoho.com
Hi All,

I am creating a hash.  One of the keys I want to point to an array,
not a string.

I have created a test:

$ perl6 -e 'my %x = [aaa => "x", b=>@["y","q","r"], c=>"z"]; say %x; for 
@(%x<b>) {say $_};'
{aaa => x, b => [y q r], c => z}
y
q
r

This seems too easy.  I have to have done something wrong.
What did I miss?

-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