Stuff with the Perl Foundation. A couple of patches in the Perl core. A few CPAN modules. That about sums it up.
One of the biggest blights on the Perl language is the dereferencing syntax. This can't be solved the Perl 6 way because leading sigils are not invariant:
my $foo = [qw/this that/];
my @foo = qw/one two/;print $foo->[0];print $foo[0];
If we had invariant sigils, the -> could be optional. We don't, so we can't. However, if we're willing to introduce another backwards incompatible change, we can clean up slices a bit:
use Data::Dumper;
my $foo = [ qw/foo bar baz/ ];
my @foo = $foo->[1,2];
print Dumper \@foo;
@foo = @$foo[1,2];
print Dumper \@foo;
__END__
$VAR1 = [
'baz'
];
$VAR1 = [
'bar',
'baz'
];
In short, allow $foo->[1,2] to return a list. Of course, this also implies: $bar->{'this', 'that'}.
Schwern has listed some of the other suggestions and Johan Vromans has proposed a working SUPER (yes, please!).
Update: Doesn't work as it does break backwards-compatibility. From perldoc perlvar:
$; The subscript separator for multidimensional array emulation. If
you refer to a hash element as
$foo{$a,$b,$c}
it really means
$foo{join($;, $a, $b, $c)}
But don't put
@foo{$a,$b,$c} # a slice--note the @
which means
($foo{$a},$foo{$b},$foo{$c})
Default is "\034", the same as SUBSEP in awk. If your keys
contain binary data there might not be any safe value for $;.
(Mnemonic: comma (the syntactic subscript separator) is a
semi-semicolon. Yeah, I know, it's pretty lame, but $, is
already taken for something more important.)
Consider using "real" multidimensional arrays as described in
perllol.
SUPER:: is just broken (Score:1)
I commented on this on p5p as well, SUPER:: is broken simply because it is ambiguous in the case of multiple inheritance. The NEXT module provides one solution, but it is notoriously slow and has some issues with edge cases (as the Catalyst folk about that). We should instead start encouraging people to use the $self->next::method syntax which the mro pragma has introduced with 5.10 and the C3 mro if they are using multiple inheritance. This
Tie::Math (Score:2)
slice (Score:1)
I like the idea, but see the point about compatibility. How about just a 'slice' function? (built-in or module)
More keystrokes, but less line noise -- intent is clear. Could DWIM for any slice-able variable:
/me wonders if this is already on CPAN
--dagolden