> still, if damian gets his way we'll no doubt be able to have
> modules/filters that mean we can still use -> :)
I *guarantee* it!
It will definitely be possible in Perl 6, because even with our primitive
earth technology we can do the reverse today:
###############################
# in line DotsForArrows.pm:
package DotsForArrows;
use Filter::Simple;
FILTER { s/\b\.(?=[a-z_\$({[])/->/gi };
###############################
# then in your code:
use DotsForArrows;
package MyClass;
sub new { bless [$_[1], 1..10], $_[0] }
sub next { my ($self) = @_; return "next is: " . shift(@$self) . "\n" }
package main;
my ($str1, $str2) = ("a", "z");
my $obj = MyClass.new($str1 . $str2);
print $obj.next() for 1..10;
print $obj.[0] . "\n";
my $next = 'next';
print $obj.$next;
#etc.
I suppose you'll want me to put that on the CPAN now. ;-)
Damian