interfacelist should be ok if your sub is like this (look at my previous email):
[* sub xxx{ *]
[- (@interfacelist)=@_; -]
...
<td>[+ $interfacelist[0] +]</td>
...
[* } *]
there might be better ways to do it, but i know nothing about them.
Hope this helps... or at least don't make it worse.
ville jungman, ulvilantie 3 b 11, 00350 helsinki, finland
tel. + 358 - 9 - 225 4482 , http://www.kolumbus.fi/vilmak
usko Herraan Jeesukseen, niin sin� pelastut. (apt. 16:31)
From: "Alexander Hartmaier" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Subject: output table with variable data
Date: Wed, 19 Feb 2003 14:45:01 +0100
Hi list!
I have to output a html table in some of my embperl pages which always looks the
same but the data is slightly different.
My approch was to write a small sub which takes the array with the data and
looks like this:
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
sub interface_list (@interfacelist)
{
print ("
<tr class=heading>
<td>Mon</td>
<td>Device</td>
<td>Interface</td>
<td>Speed</td>
<td>Line</td>
</tr>
");
for $indx ( 0 .. $#interfacelist )
{
print ("
<tr class=light>
<td class= $interfacelist[$indx][0] ><a> $interfacelist[$indx][1]
</a></td>
<td><a href='view-device.epl?id_device=$interfacelist[$indx][2] '>
$interfacelist[$indx][3] </a></td>
<td><a href='view-interface.epl?id_interface= $interfacelist[$indx][4] '>
$interfacelist[$indx][5] </a></td>
<td><a href='view-line.epl?id_line= $interfacelist[$indx][6] '>
$interfacelist[$indx][7] </a></td>
</tr>
");
};
}
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
My problem is that when I call the sub with '[+ interface_list (@interfacegrp)
+]' the lines are appended to the end of the output instead of the line where I
call it!
Furthermore the array @interfacelist is empty...
I think there is a better way to handle this problem!
Gerald or anybody else has an idea?
THX Alex
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
_________________________________________________________________
MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
