I am trying to get the value from a model call into a variable so I can 
use it for creating a DB record. I have tried multiple ways and cannot get 
the value to return. Here is my current attempt:

my $dept = $c->model('ORANGES::Departments')->search_rs({'department_code' 
=> $departmentcode}, {
                columns => ['department_id'] });

This returns "1".

I tried this:

my $dept = $c->model('ORANGES::Departments')->search_rs({'department_code' 
=> $departmentcode}, {
                columns => ['department_id'] })->single;

and got a hash reference. I know I am missing something very simple. If I 
was putting this into the stash I know I could access the value, but I am 
at a loss as to how to get to it inside my code.

_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to