Re: Unblessed reference problem

2012-05-21 Thread sono-io
On May 20, 2012, at 8:28 AM, Shlomi Fish wrote: > The problem is that «$self->animals» returns an (unblessed) array reference > and > not the list of individual animals, so you should do something like: > > for my $animal (@{ $self->animals }) { Thanks, Shlomi. That did it. Moose is a

Re: Unblessed reference problem

2012-05-20 Thread Chris Nehren
On Sun, May 20, 2012 at 21:44:29 -0400 , John SJ Anderson wrote: > On Sunday, May 20, 2012 at 9:28 PM, Peter Scott wrote: > > On Sun, 20 May 2012 18:28:10 +0300, Shlomi Fish wrote: > > > Note that I think I saw a way to return the flattened array in Moose, > > > but I don't remember the specifics.

Re: Unblessed reference problem

2012-05-20 Thread John SJ Anderson
On Sunday, May 20, 2012 at 9:28 PM, Peter Scott wrote: > On Sun, 20 May 2012 18:28:10 +0300, Shlomi Fish wrote: > > Note that I think I saw a way to return the flattened array in Moose, > > but I don't remember the specifics. > > > > > auto_deref => 1 > … which is semi-deprecated/recommende

Re: Unblessed reference problem

2012-05-20 Thread Peter Scott
On Sun, 20 May 2012 18:28:10 +0300, Shlomi Fish wrote: > Note that I think I saw a way to return the flattened array in Moose, > but I don't remember the specifics. auto_deref => 1 -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.com/ http://www.informit.com/store/product.asp

Re: Unblessed reference problem

2012-05-20 Thread Shlomi Fish
Hi Marc, On Sat, 19 May 2012 20:09:00 -0700 sono...@fannullone.us wrote: > I'm trying the following code from Programming Perl, but I'm get the > error "Can't call method "type" on unblessed reference at untitled text 10 > line 23". I've checked the errata page, but there's nothing liste

Unblessed reference problem

2012-05-19 Thread sono-io
I'm trying the following code from Programming Perl, but I'm get the error "Can't call method "type" on unblessed reference at untitled text 10 line 23". I've checked the errata page, but there's nothing listed for it. Searching on the error message brings up pages about unblessed refe