Jenda, Sorry -- I was not quoting my own code precisely and I am using strict and warnings. I am using parenthesis. I attached the exact code for the subroutine below.
--- Jenda Krynicky <[EMAIL PROTECTED]> wrote: > From: Richard Heintze <[EMAIL PROTECTED]> > > After several hours I tracked it down to these > line of > > code. The concantenation is failing suddenly! > > > > my $hidden="<table><tr><td>"; > > &FormElements(\$hidden...); > > > > sub FormElements{ > > my $hidden = @_; > > This line is incorrect. > > > my $t1 = qq[<input type=text value=mumble>]; > > $$hidden .= $t1; > > As > use strict; > would have told you. > > The problem is that the > my $hidden = @_; > sets $hidden to the number of elements in @_. Not to > the first > parameter passed to FormElements(). > > So the $$hidden doesn't access the global $hidden > variable, but a > variable whose name is the number. > > Try to print the $hidden inside the subroutine! > > You want either > my ($hidden) = @_; > or > my $hidden = shift(@_); > > sub FormElements { my ($me, $next, $ev_count, $curr_true, # integer array created in insert data $prob_innoc, $prob_guilt, $hidden) = @_; # The first time we view the Enter Probabilities page (display) # we have the option of specifing admissibility (the probability of the evidence being admissible in court) # and the probability the fact is true. # # When there are subsequent assertions or suspects, there is no need to allow the user to change this information # so we surpress the text edit box. # my $bReadOnly = !$me->bFirstSuspect(); # $me->{pass}==0 && $next==1; # Can the user change this? Yes, if this is the first Suspect/Assertion. my $t3 = $me->{admissibility}; my $admis = sprintf "%3d", $t3->[$ev_count]; print ($me->bShowAdmissibility()?(qq[ <TD ALIGN="CENTER" STYLE="font-family:serif; font-size:18px; font-weight: bold; background-color:#ffcc00">] .($bReadOnly?qq[$admis <INPUT class=debug READONLY TYPE=TEXT NAME=prob_admis$ev_count SIZE="2" VALUE="$admis" />]:qq[<INPUT TYPE=TEXT NAME=prob_admis$ev_count SIZE="2" VALUE="$admis" />]) ."</TD>"):""); print qq[ <TD ALIGN="CENTER" STYLE="font-family:serif; font-size:18px; font-weight: bold; background-color:#ffcc00">]; # older code: $me->{base_type}=~"Rank" || $me->{base_type}=~"RA" || $me->{base_type}=~"Compare Assertions" # old code: ($me->{base_type} == &case_constants::btCompareAssertions || $me->{base_type} == &case_constants::btRankSuspects) if ($me->MultiSuspectCase() && $bReadOnly){ # No input box here! my $t2 = @{$$curr_true}[$ev_count]; # This is so wierd. Why do I need to explicitly cast it? $t2 = sprintf "%3.3f", ($t2<=0?0:$t2); my $t3 = qq[<INPUT class=debug TYPE=TEXT NAME="prob_true$ev_count" VALUE="$t2" SIZE=2>]; print $t2.$t3; # Why does not this concatenation work? $$hidden = $$hidden.qq[\n<TR class=debug><TD>prob_true$ev_count</TD><TD>$t3%</TD></TR>\n]; } else { # Input box: user can alter this print qq[ <INPUT TYPE="TEXT" ID="prob_true$ev_count" NAME="prob_true$ev_count" SIZE="7" OnChange="form_field_OnChange(this);" MAXLENGTH="6">%</TD> ]; } print qq| <TD ALIGN="CENTER" STYLE="font-family:serif; font-size:14px;background-color:#cc9900"> <INPUT ID="prob_guilt$ev_count" NAME="prob_guilt$ev_count" SIZE="7" OnChange="form_field_OnChange(this);" |; if ($me->{pass}!=1){ print qq| VALUE="|.($prob_guilt?$prob_guilt:"").qq|" |; } print qq| MAXLENGTH="6">%</TD> <TD ALIGN="CENTER" STYLE="font-family:serif; font-size:14px;background-color:#cc9900"> <INPUT TYPE="TEXT" ID="prob_innoc$ev_count" OnChange="form_field_OnChange(this);" NAME="prob_innoc$ev_count" SIZE="7" |; if ($me->{pass}!=1){ print qq|VALUE="|.($prob_innoc?$prob_innoc:"").qq|"|; } print " MAXLENGTH=6>%</TD>\n"; } __________________________________ Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard http://antispam.yahoo.com/whatsnewfree -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]