Hi,

I am trying to make a simple search, but I don't know what I am doing wrong, and it doesn't print the right result:

my $roles = $schema->resultset("UserRole")->search;

while (my $role = $roles->next) {
print $role->id_role . "\n";
}

It prints:

Intra::User=HASH(0x20efc48)
Intra::User=HASH(0x20dfea8)
...

I am sure something is missing and I am not dereferencing something somewhere, but I can't see where. If I use exactly the same code but instead of searching in the user_role table I search in the role table, and print a field from that table, it prints fine.

In the role table I have the fields "id" and "role" and if I print $role->role, it works well. In the user_role table I have id_user and id_role fields, but if I print $role->id_role, it doesn't print correctly, just as I shown.

Help!

Thank you.

Octavian


_______________________________________________
List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
Wiki: http://dbix-class.shadowcatsystems.co.uk/
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
Searchable Archive: http://www.mail-archive.com/[email protected]/

Reply via email to