develooper Front page | perl.beginners | Postings from May 2012

Re: Unblessed reference problem

Thread Previous | Thread Next
From:
sono-io
Date:
May 21, 2012 12:56
Subject:
Re: Unblessed reference problem
Message ID:
A6DFDE03-F0F1-4127-858F-E8DBF1963400@fannullone.us
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 new animal to me, so hopefully scripts like this will help me wrap my head around it.

Marc
Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About