The most surprising change I've discovered so far in Perl6 is that the reference operator ('\') is no more. That is, the following code, while valid in both Perl5 and Perl6, behaves differently in each:
my %hash; my $hashref = \%hash;
my %hash; my $hashref = $(%hash); # itemization
$hashref
, do like this:my @keys = $hashref.keys; # Perl5 equivalent: # my @keys = keys %{$hashref};So, the $hashref feels less like a pointer and more like a container. The scalar delegates to its value, which is why the ".keys" works in this example without needing to explicitly dereference the scalar.
my @array; my $arrayref = \@array; for @($arrayref) -> $val { say $val; }