Camelia
Prev: slurp

kv

examples/hash/print_hash_kv.p6
#!/usr/bin/env perl6
use v6;

my %user =
    "fname" => "Foo",
    "lname" => "Bar",
    "email" => "foo@bar.com",
;

for %user.kv -> $key, $value {
    say "$key  $value";
}

Output

examples/hash/print_hash_kv.p6.out
fname  Foo
lname  Bar
email  foo@bar.com

Prev: slurp

Table of Contents

Comments

In the comments, please wrap your code snippets within <pre> </pre> tags and use spaces for indentation.
comments powered by Disqus

Perl 6 Tricks and Treats newsletter

Register to the free newsletter now, and get updates and news.
Email:
Name: