[Wellington-pm] Referencing arrays in an object

Cliff Pratt enkidu at cliffp.com
Sat May 27 22:39:23 PDT 2006


Hi all,

Can someone please clarify something for me?

I have an object for which I am creating accessor methods using 
Class::Accessor::Fast. One of the methods is called 'grid' initialised so:

$self->grid([]) ;

I can access the elements of the array referred to by $self->grid by the 
following:

$xxxx = $self->grid->[$i] ; # Within a method of the class

I'm not using any accessor method here, am I? I theenk that the accessor 
method will be something like the following:

$xxxx = $self->grid([$i]) ; # Will this work?

Obviously I'm going to give it a crack, but a little insight from one of 
the gurus would be appreciated.

Cheers,

Cliff

-- 

http://barzoomian.blogspot.com


More information about the Wellington-pm mailing list