<font size=2 face="sans-serif">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:</font>
<br>
<br><font size=2 face="sans-serif">my $dept = $c-&gt;model('ORANGES::Departments')-&gt;search_rs({'department_code'
=&gt; $departmentcode}, {</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; columns =&gt; ['department_id'] });</font>
<br>
<br><font size=2 face="sans-serif">This returns &quot;1&quot;.</font>
<br>
<br><font size=2 face="sans-serif">I tried this:</font>
<br>
<br><font size=2 face="sans-serif">my $dept = $c-&gt;model('ORANGES::Departments')-&gt;search_rs({'department_code'
=&gt; $departmentcode}, {</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; columns =&gt; ['department_id'] })-&gt;single;</font>
<br>
<br><font size=2 face="sans-serif">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.<br>
</font>
<br>