in reply to Re: Formatting variables
in thread Formatting variables
looks like a nested structure to me, TIMTOWTDI
These are actually HTML form element names, not Perl variables but they are dynamically generated by a Perl script like so:
This is part of a 4500+ line script that was originally written a long time ago and has been added to and modified lots over the years. Hence lack of white space and other poor legibility on some of the older bits of code. Nowadays I insert spaces either side of = and a space after a comma.$query=$dbh->prepare("SELECT idBusiness,emaillist,private,name,title,d +escription FROM Business ORDER BY metric"); $query->execute(); while (($id,$em,$private,$text,$title,$desc)=$query->fetchrow_array()) + { $list_color=$em?'black':'slategray'; ($chk, $sub, $crm, $warmth)=$dbh->selectrow_array("SELECT Business +_idBusiness, subscribe, CRMaccess, warmth FROM Business_has_Contact W +HERE Business_idBusiness = $id AND Contact_idContact = $data{'contact +'}"); if ($chk) { $check=' checked'; $dis=''; } else { $check=''; $dis=' disabled'; } $warmth = 0 unless $warmth; $crmr_chk = $crmw_chk = ''; $crmr_chk = ' checked' if $crm; $crmw_chk = ' checked' if $crm eq 'W'; $subscribe=$sub?' checked':''; $text="<i>$text</i> <span class=\"privatelist\">[private]</span>" +if $private; print "<tr>\n<td><input type=\"checkbox\" name=\"bus_$id\" onChang +e=\"subscribe(this,$id);\"$check>\n"; print "<input type=\"checkbox\" name=\"sub_$id\"$subscribe$dis></t +d>\n"; print "<td title=\"$title\" style=\"color:$list_color\">$text</td> +\n"; print "<td style=\"text-align:center\"><input type=\"checkbox\" na +me=\"crmr_$id\" onClick=\"crmAccess(this, $id);\"$crmr_chk>\n"; print "<input type=\"checkbox\" name=\"crmw_$id\" onClick=\"crmAcc +ess(this, $id);\"$crmw_chk></td>\n"; print "<td><img src=\"/images/site/warmth$warmth.png\" style=\"wid +th:28px\"> </td>\n" if $chk; print "</tr>"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Formatting variables
by LanX (Saint) on Nov 29, 2020 at 17:50 UTC | |
by Bod (Parson) on Nov 29, 2020 at 20:09 UTC |