If you have ever written any Perl OO code, I recommend you to take a look at Luke Palmer's CPAN module Perl6::Attributes, which is extremely simple and handy.
Instead of writing something like
sub method {
my $self = shift;
$self->{attr} = '...';
}
we can now write
sub method {
my $self = shift;
$.attr = '...';
}
in Perl5.
Another example is replacing the ugly syntax
sub method {
my $self = shift;
@{$self->{attrs}} = qw(a b c);
}
with the Perl6-ish syntax
sub method {
my $self = shift;
@.attrs = qw(a b c);
}
You see, it is pretty cool!
I've already had a try in my recent Perl module developements. Perl6::Attributes makes the source of my Perl OO modules amazingly neat.
Re (Score:1)
Is this more Perl6ish than Perl6? (Score:1)
Bill
# I had a sig when sigs were cool
use Sig;
Re:Is this more Perl6ish than Perl6? (Score:1)
Re: Lexical::Attributes (Score:1)
Yep, Lexical::Attributes seems to be more Perl6-ish and hence even more revolutionary.
But it also deserves more effort to get used to the syntax in Perl5 modules.