Perl 6 Perl 6 today #23

Formatted display of a hash

If you don't like tabs, the ".fmt" method can do formatted display:

my %h = <apple 4 cherry 7 banana -6>;  
say %h.fmt('%s => %s');

or

%h.fmt('%s => %s').say;

Result:

apple => 4
cherry => 7
banana => -6
Copyright © 2009
http://www.pmichaud.com/2009/pres/