Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

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

by tobyink (Canon)
on Jan 12, 2012 at 20:13 UTC ( [id://947626]=note: print w/replies, xml ) Need Help??


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

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.

Replies are listed 'Best First'.
Re^5: Can't call method "find" on an undefined value
by Anonymous Monk on Jan 12, 2012 at 20:28 UTC
    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.

        in what circumstances  c->model would return  undef. when the DB and schema exist? Schema
        package AddressBook::Schema::AddressDB::Result::Address; # Created by DBIx::Class::Schema::Loader # DO NOT MODIFY THE FIRST PART OF THIS FILE use strict; use warnings; use base 'DBIx::Class::Core'; __PACKAGE__->load_components("InflateColumn::DateTime"); =head1 NAME AddressBook::Schema::AddressDB::Result::Address =cut __PACKAGE__->table("addresses"); =head1 ACCESSORS =head2 id data_type: 'integer' is_nullable: 0 =head2 person data_type: 'integer' is_nullable: 0 =head2 location data_type: 'varchar' is_nullable: 1 size: 20 =head2 postal data_type: 'text' is_nullable: 1 =head2 phone data_type: 'varchar' is_nullable: 1 size: 20 =head2 email data_type: 'varchar' is_nullable: 1 size: 100 =cut __PACKAGE__->add_columns( "id", { data_type => "integer", is_nullable => 0 }, "person", { data_type => "integer", is_nullable => 0 }, "location", { data_type => "varchar", is_nullable => 1, size => 20 }, "postal", { data_type => "text", is_nullable => 1 }, "phone", { data_type => "varchar", is_nullable => 1, size => 20 }, "email", { data_type => "varchar", is_nullable => 1, size => 100 }, ); __PACKAGE__->set_primary_key("id"); __PACKAGE__->belongs_to( person => 'AddressBook::Schema::AddressDB::Result::People'); # Created by DBIx::Class::Schema::Loader v0.07002 @ 2012-01-04 14:50:1 +5 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:LXbQtPHwvP3E1JP8yppNhQ # You can replace this text with custom content, and it will be preser +ved on regeneration 1;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (4)
As of 2024-03-19 06:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found