Gossamer Forum
Home : Products : DBMan : Installation :

repeating table rows

Quote Reply
repeating table rows
Help!

I'm trying to change the way my "view all" records appear but can't get it to work. Under the sub html_record in the html.pl file all I'm changing is the table format. Instead of repeating tables, I want one table with repeating rows.

When I have the table nested in print qq| like this:

print qq|
<table cellpadding=4 cellspacing=2 border=1>
<tr>
<td>data</td><td>data</td></tr>
<tr>
<td>$rec{'data'}</td><td>data</td></tr>
<tr>
<td>$rec{'data'}</td><td>data</td></tr>
</table>
|;

I have no problem. But, when I nest the row in print qq| like this:

<table cellpadding=4 cellspacing=2 border=1>
<tr>
<td>data</td>
<td>data</td>
<td>data</td></tr>
print qq|
<tr>
<td>$rec{'data'}</td>
<td>$rec{'data'}</td>
<td>$rec{'data'}</td></tr>
|;
</table>

I end up with this message:

Error loading required libraries.

Check that they exist, permissions are set correctly and that they compile.
Reason: Unterminated <> operator at ./html.pl line 127.

And of course, that line is where the print qq| is. Am I missing something plainly obvious, or is it that print qq can't go inside the table tag?

Many thanks for the help. Great script!
Quote Reply
Re: repeating table rows In reply to
 
Quote:
Am I missing something plainly obvious, or is it that print qq can't go inside the table tag?

Remember that print qq| and its corresponding |; are Perl commands. The whole point of the | is to tell Perl "print out everything between these two symbols." When Perl runs into your lines

<td>data</td></tr>
print qq|
<tr>

it thinks you want to print out

<td>data</td></tr>
print qq

and then it doesn't know what to do. It tries to figure out what command you're sending with the <tr>, but it doesn't make any sense.

The short answer to your question is to take out the print qq| from the middle of your code and you should be fine.

The only time you'll need to add a print qq| statement in the middle of your form or record definition is if you have an intervening Perl command, like an "if" statement.


------------------
JPD
Quote Reply
Re: repeating table rows In reply to
Thanks jpd. I'll give it a try.

jb