<div dir="ltr">Thank you all for the very sage replies. This was all so very instructive that I put the derefrencing syntax in the comments of my code in case I need in the future.<br></div><div class="gmail_extra"><br><div class="gmail_quote">2015-08-28 1:31 GMT-05:00 Kadir Beyazlı <span dir="ltr"><<a href="mailto:kadirbeyazli@gmail.com" target="_blank">kadirbeyazli@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Richard,<br>
<span class=""><br>
On Thu, Aug 27, 2015 at 8:05 PM, Richard Reina <<a href="mailto:gatorreina@gmail.com">gatorreina@gmail.com</a>> wrote:<br>
> That worked! Thank you very much.<br>
><br>
> Interestingly though $input_hash->{ $key } appears as a hash ref<br>
> "HASH(0xa1d2344)" which I was not able to dereference with<br>
> %$input_hash->{key}.<br>
</span>[KB] WK's answer is absolutely right. You can not use<br>
%$input_hash->{key}, you must use brackets : %{$input_hash->{key}}.<br>
<div class="HOEnZb"><div class="h5">This doesn't bother me much because all I really need<br>
> to know is that it has value -- that tells me the user checked the box for<br>
> this option.<br>
><br>
> So, instead of looking at the actual value I was just going to do:<br>
><br>
>     # get parameter for accomp type keys<br>
>       foreach my $key ( keys %$Accomps ) {<br>
><br>
>       if ( param( $key ) ) { # paramter has value<br>
>           $input_hash->{ $key } = $Accomps->{ $key };<br>
><br>
>           # user checked this box. Enter a record into TO_DO table<br>
><br>
>       }<br>
>       }<br>
><br>
> Is that okay? Or would such an un-exact way of doing it have a downside?<br>
><br>
><br>
> 2015-08-27 11:24 GMT-05:00 Yitzchak Scott-Thoennes <<a href="mailto:sthoenna@gmail.com">sthoenna@gmail.com</a>>:<br>
>><br>
>> The symbolic reference there is $key; you are (unintentionally, I'd<br>
>> guess) using print's:<br>
>><br>
>>     print FILEHANDLE LIST<br>
>><br>
>> syntax, and it is trying to use $key as the filehandle.<br>
>><br>
>> Maybe you meant:<br>
>><br>
>>     print $key, $input_hash->{ $key }, "\n"<br>
>><br>
>> On Thu, Aug 27, 2015 at 8:42 AM, Richard Reina <<a href="mailto:gatorreina@gmail.com">gatorreina@gmail.com</a>><br>
>> wrote:<br>
>> > Hi WK,<br>
>> ><br>
>> > Thanks for the reply. Line 577 is the print statement  print $key<br>
>> > $input_hash->{ $key } . "\n"; In the foreach. I know I shouldn't be<br>
>> > printing<br>
>> > here however, I just want to see what value comes across for for example<br>
>> > $input_hash->{ '13' } before I create a DB record based on that value.So<br>
>> > I<br>
>> > guess I just need help figuring out how to see or get the value out of<br>
>> > $input_hash->{ID NUMBER}.<br>
>> ><br>
>> ><br>
>> ><br>
>> > 2015-08-27 10:07 GMT-05:00 WK <<a href="mailto:wanradt@gmail.com">wanradt@gmail.com</a>>:<br>
>> >><br>
>> >> 2015-08-27 17:28 GMT+03:00 Richard Reina <<a href="mailto:gatorreina@gmail.com">gatorreina@gmail.com</a>>:<br>
>> >><br>
>> >> > After figuring out how to accommodate my placeholder in<br>
>> >> > selectall_hashref I<br>
>> >> > did this:<br>
>> >> ><br>
>> >> >  my $Accomps = $dbh->selectall_hashref( $q, 'ID', \%attr, $Sid );<br>
>> >><br>
>> >> If you need placeholder here, but you don't have need for any<br>
>> >> attributes, you may use `undef` here<br>
>> >><br>
>> >> my $Accomps = $dbh->selectall_hashref( $q, 'ID', undef, $Sid );<br>
>> >><br>
>> >> > Then as you suggested I do:<br>
>> >> ><br>
>> >> >  # get parameter for accomp type keys<br>
>> >> >       foreach my $key ( keys %$Accomps ) {<br>
>> >> >       print "Checking: " . $key . " for value.\n";<br>
>> >> >       if ( param( $key ) ) {<br>
>> >> >           $input_hash->{ $key } = $Accomps->{ $key };<br>
>> >> >           print $key $input_hash->{ $key } . "\n";<br>
>> >> >       }<br>
>> >> >       }<br>
>> >> ><br>
>> >> > (just printing temporarily to see if it trapped the values)<br>
>> >><br>
>> >> Here we actually don't need values of $Accomps-hashref, we just using<br>
>> >> it as list to check out form values, so depending of your futher<br>
>> >> needs, you may assign your specific value here, like, for example:<br>
>> >><br>
>> >>            $input_hash->{ $key } = 1;<br>
>> >><br>
>> >> > However, I get this error:<br>
>> >> ><br>
>> >> >  Route exception: Can't use string ("1") as a symbol ref while<br>
>> >> > "strict<br>
>> >> > refs"<br>
>> >> > in use at /home/richard/Dancer2/MyApp/bin/../lib/MyApp.pm line 557.<br>
>> >> ><br>
>> >> > Any idea what I am doing wrong?<br>
>> >><br>
>> >> What is on line 577 of your MyApp.pm?<br>
>> >><br>
>> >> Wbr,<br>
>> >> --<br>
>> >> Kõike hääd,<br>
>> >><br>
>> >> Gunnar<br>
>> >> _______________________________________________<br>
>> >> dancer-users mailing list<br>
>> >> <a href="mailto:dancer-users@dancer.pm">dancer-users@dancer.pm</a><br>
>> >> <a href="http://lists.preshweb.co.uk/mailman/listinfo/dancer-users" rel="noreferrer" target="_blank">http://lists.preshweb.co.uk/mailman/listinfo/dancer-users</a><br>
>> ><br>
>> ><br>
>> ><br>
>> > _______________________________________________<br>
>> > dancer-users mailing list<br>
>> > <a href="mailto:dancer-users@dancer.pm">dancer-users@dancer.pm</a><br>
>> > <a href="http://lists.preshweb.co.uk/mailman/listinfo/dancer-users" rel="noreferrer" target="_blank">http://lists.preshweb.co.uk/mailman/listinfo/dancer-users</a><br>
>> ><br>
>> _______________________________________________<br>
>> dancer-users mailing list<br>
>> <a href="mailto:dancer-users@dancer.pm">dancer-users@dancer.pm</a><br>
>> <a href="http://lists.preshweb.co.uk/mailman/listinfo/dancer-users" rel="noreferrer" target="_blank">http://lists.preshweb.co.uk/mailman/listinfo/dancer-users</a><br>
><br>
><br>
><br>
> _______________________________________________<br>
> dancer-users mailing list<br>
> <a href="mailto:dancer-users@dancer.pm">dancer-users@dancer.pm</a><br>
> <a href="http://lists.preshweb.co.uk/mailman/listinfo/dancer-users" rel="noreferrer" target="_blank">http://lists.preshweb.co.uk/mailman/listinfo/dancer-users</a><br>
><br>
<br>
<br>
<br>
</div></div><span class="HOEnZb"><font color="#888888">--<br>
Kadir Beyazlı<br>
Computer Engineer<br>
GSM : <a href="tel:%2B90%20535%20821%2050%2000" value="+905358215000">+90 535 821 50 00</a><br>
</font></span><div class="HOEnZb"><div class="h5">_______________________________________________<br>
dancer-users mailing list<br>
<a href="mailto:dancer-users@dancer.pm">dancer-users@dancer.pm</a><br>
<a href="http://lists.preshweb.co.uk/mailman/listinfo/dancer-users" rel="noreferrer" target="_blank">http://lists.preshweb.co.uk/mailman/listinfo/dancer-users</a><br>
</div></div></blockquote></div><br></div>