Alex, Thanks for your reply and taking the time.
> Hello Robert, Karen and the rest, > > Robert, to me it appears that the problem indeed lies in $pwqref. That's > why I think Karen's idea is very good. > What I tried was to run as much of your code as possible, and I ended up > with this bit: > > my $useropt=2; > my %options; > my @htmlselect = (); > my %pwqref = ('1','a','2','b','3','c','4','d'); # didn't have another > way > > foreach (sort keys %pwqref) { > my $sel = ( $_ eq $useropt ? 1 : 0 ); > my %row = ('selectcode' => $_, 'selectdesc' => $pwqref{$_}, > 'isSel' => $sel); > push @htmlselect, \%row; > print(" C=$_, D=$pwqref{$_}, SEL=$sel\n"); > } > $template->param('htmlselect' => [EMAIL PROTECTED]); > > As you see, because I didn't have your function which would populate the > pwqref "hash" I just made it up, other than that it's more or less your > own code. Now my code works :) So it would really help to print the > actual values of pwqref the way Karen suggested. I'm confident that > you'll find that hash to be somehow malformed. Well jeez, I used Karen's map() code line for my log, and the data was the same, so my pwqref seems okay. Still, just for fun, I actually hard-coded my hash just as you did, and changed the other references as required, and it still didn't work. So I'm really stumped. I hate when this happens... > P.S. I just wanted to point out that to give value to $sel a slightly > simpler line would suffice: > > my $sel = $_ eq $useropt; > > Your version is like saying: "if it's true, let it be true, but if it > ain't then it ain't" :) > I do it your way too sometimes when I forget in what language 1 is a > true fact and 0's just a bunch of lies. However, since in our ... Yeah, you're right. I do know and understand that, and have done it that way in numerous other places. Like you said, too many languages. Old habits die hard. This is Perl, right? :) Robert ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 _______________________________________________ Html-template-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/html-template-users