On Sat, 8 Sep 2001, Gustavo A. Baratto wrote:

> How can I have an array in a class attribute?
>
> In my constuctor this is not working: (I need $self->{ARRAY} to be an array)
>
>
> sub new
> {
>     my $class = shift;
>     my $self = { };
>     $self->{IFCONFIG} = "/etc/ifconfig.temp";
>     $self->{NEWIP} = "/home2/nas3/nas/.newip.temp";
>     $self->{IP} = undef;
>     $self->{SOURCE} = "ifconfig";
>     $self->{ARRAY} = undef;
>
>     bless($self, $class);
>     return($self);
> }

How are you initializing this? It has to be an array reference:

$self->{ARRAY} = [ 0, 1, 2, 3, 5 ];

-- Brett
                                          http://www.chapelperilous.net/
------------------------------------------------------------------------
A poet who reads his verse in public may have other nasty habits.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to