Skip to content

Commit 98deab8

Browse files
committed
Merge pull request #272 from gfldex/master
interpolation for hash (slices) has changed too
2 parents 258811b + daae6df commit 98deab8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

doc/Language/5to6-nutshell.pod

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,7 @@ I<Indexing>
342342
343343
say $calories{apple}; # Perl 5
344344
say %calories<apple>; # Perl 6 - angle brackets; % instead of $
345+
say %calories«$key»; # Perl 6 - double angles interpolate as a list of Str
345346
=end item
346347
347348
=begin item
@@ -350,6 +351,8 @@ I<Value-slicing>
350351
say join ',', @calories{'pear', 'plum'}; # Perl 5
351352
say join ',', %calories{'pear', 'plum'}; # Perl 6 - % instead of @
352353
say join ',', %calories<pear plum>; # Perl 6 (prettier version)
354+
my $keys = 'pear plum';
355+
say join ',', %calories«$keys»; # Perl 6 the split is done after interpolation
353356
=end item
354357
355358
=begin item

0 commit comments

Comments
 (0)