RE: dereferencing a list from a class

2003-11-24 Thread Rajesh Dorairajan
--Original Message- From: James Edward Gray II [mailto:[EMAIL PROTECTED] Sent: Saturday, November 22, 2003 8:18 AM To: Rajesh Dorairajan Cc: '[EMAIL PROTECTED]' Subject: Re: dereferencing a list from a class On Nov 21, 2003, at 3:19 PM, Rajesh Dorairajan wrote: > I've

Re: dereferencing a list from a class

2003-11-22 Thread drieux
On Saturday, Nov 22, 2003, at 08:17 US/Pacific, James Edward Gray II wrote: On Nov 21, 2003, at 3:19 PM, Rajesh Dorairajan wrote: I've a class (blessed, of course :)) that has variables like: $self->a = "1"; $self->b = "2"; $self->c = [ '1', '2', '3', '4' ]; I think/hope you meant: $self->{a}

Re: dereferencing a list from a class

2003-11-22 Thread R. Joseph Newton
Rajesh Dorairajan wrote: > I've a class (blessed, of course :)) that has variables like: > > $self->a = "1"; > $self->b = "2"; > $self->c = [ '1', '2', '3', '4' ]; > > Now, I want to write a foreach loop to iterate through $self->c and print > the values. However: > > foreach my $foo ( $self->c )

Re: dereferencing a list from a class

2003-11-22 Thread James Edward Gray II
On Nov 21, 2003, at 3:19 PM, Rajesh Dorairajan wrote: I've a class (blessed, of course :)) that has variables like: $self->a = "1"; $self->b = "2"; $self->c = [ '1', '2', '3', '4' ]; I think/hope you meant: $self->{a} = '1';# any reason we're quoting integers? $self->{b} = '2'; $self

FW: dereferencing a list from a class

2003-11-22 Thread Rajesh Dorairajan
message bounced. retrying -Original Message- From: Rajesh Dorairajan Sent: Friday, November 21, 2003 1:19 PM To: '[EMAIL PROTECTED]' Subject: dereferencing a list from a class I've a class (blessed, of course :)) that has variables like: $self->a = "1"; $se

dereferencing a list from a class

2003-11-22 Thread Rajesh Dorairajan
I've a class (blessed, of course :)) that has variables like: $self->a = "1"; $self->b = "2"; $self->c = [ '1', '2', '3', '4' ]; Now, I want to write a foreach loop to iterate through $self->c and print the values. However: foreach my $foo ( $self->c ) { print $foo; } gets me the whole