Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^3: Can't call method "find" on an undefined value

by Anonymous Monk
on Jan 12, 2012 at 20:09 UTC ( [id://947623]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Can't call method "find" on an undefined value
in thread Can't call method "find" on an undefined value

the problem is in this line  my $persid = $c->model('AddressDB::Addresses')->find({person => $id});

Replies are listed 'Best First'.
Re^4: Can't call method "find" on an undefined value
by tobyink (Canon) on Jan 12, 2012 at 20:13 UTC

    That line, or perhaps the next one. They both call a find method.

    Whichever line it is though, the problem is that the call to $c->model is returning undef.

      why is that? i don't get since $id has a value... my $id = $c->request->arguments->[0]*1; its like it's not seeing the value of $id

        $id is irrelevant. As I say, it is the call to model that is failing, not the call to find. find is not being called because it can't be called if model returns undef.

Re^4: Can't call method "find" on an undefined value
by Anonymous Monk on Jan 17, 2012 at 18:13 UTC
    i've tried to see what's in  c->model and came up with this error Use of uninitialized value $_[0] in join or string at /usr/local/share/perl/5.10.1/Catalyst/Log.pm line 88. and this is the line 88  my $message = join( "\n", @_ ); from fct
    sub _log { my $self = shift; my $level = shift; my $message = join( "\n", @_ ); $message .= "\n" unless $message =~ /\n$/; my $body = $self->_body; $body .= sprintf( "[%s] %s", $level, $message ); $self->_body($body); }
    any idea?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://947623]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2024-04-16 10:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found