Three $selfs in one line! And it's really not encoding any information, it's just clutter that results from Perl's lack of explicit object-oriented support. However, Using the magic of source filters, we can now write it:

Perl6::Attributes takes the Perl 6 secondary sigil . and translates it into a hash access on $self. No, it doesn't support other names for your invocant (but it could very easily; I'm just lazy), and no, it doesn't support objects written by crazy people based on array, scalar, or (!) glob references.

You still inflect the primary sigil, unlike in Perl 6. See Perl6::Variables for a way to use Perl 6's uninflected sigils... but don't expect it to work with this module.

There's also a nice little "feature" that you get for trading the ability to name your variables the same with different sigils (by the way, you can't do that). Say $self->{foo} is an array ref:

@.foo; # the array itself
$.foo; # the reference

Which means that even if you're using an array referentially, you can usually avoid writing those pesky @{}s everywhere.

Perl6::Attributes now also translates ./method and ./method(args) to $self-method> and $self-method(args)>.

SEE ALSO

AUTHOR

Luke Palmer <luke@luqui.org>

COPYRIGHT

Copyright (C) 2005 by Luke Palmer
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.8.3 or,
at your option, any later version of Perl 5 you may have available.

Module Install Instructions

To install Perl6::Attributes, simply copy and paste either of the commands in to your terminal