Hi,

Peter Schwenn wrote:
> If a class attribute declaration has a . or ! twigil, e.g. has @!items, do
> all the ensuing references to @items in the class's methods have to include
> the twigil or can the variable be written thereafter simply @items without
> the twigil?

If you declare a private attribute

has @!items

then all your references to that attribute have to include that sigil.

If you declare it with the dot sigil:

has @.items

then it creates an accessor, so that self.items or @.items work for
accessing, as well as @!items.

You can also declare

has @items;

in which case a private attribute @!items is declared, with a lexical
alias @items (without any twigil).

This could become a FAQ entry...

Moritz
-- 
Moritz Lenz
http://perlgeek.de/ |  http://perl-6.de/ | http://sudokugarden.de/

Reply via email to