I searched CPAN for Perl6 and did not
find any modules that offer that ability yet. You
could do something like:
use strict;
my $code = do {local $/;<DATA>};
$code =~ s/(\w)\.(\w)/$1->$2/g;
$code =~ s/(?<!\w)_(?!\w)/./g;
eval $code;
die $@ if $@;
__DATA__
my $foo = Foo.new();
$foo.foo('foo');
$foo.bar('bar');
$foo.baz('baz');
print $foo.foo _ "\n" _ $foo.bar _ "\n" _ $foo.baz _ "\n";
package Foo;
use Class::MethodMaker
new => 'new',
get_set => [ qw /foo bar baz / ];
but not only is that twisted (and silly), there
is more than likely some usage of . and _ that
i missed with the regexes. Best to just stick
with the arrow notation - it is only one more
character to type, after all ... that or start
using Python ... /duck
UPDATE: belg4mit++ for suggesting Filter::Simple
- i missed that one ... |