in reply to array problem
the for loop takes each item in the list @a and applies the code within the loop - but you could use map instead:#!/agl/tools/perl/bin/perl my @a=qx (rsh -l sonaxisz 'source.login ; findbug -p | sort -u | %s se +rver); print "Content-type:text/html\n\n"; print "<html><body><table>"; for(@a){ print "<tr><td>$_</td></tr>"; } print "</table></body></html>";
any good for you?@a = ("A","B","C"); print "Content-type:text/html\n\n"; print "<html><body><table>"; print map("<tr><td>$_</td></tr>",@a); print "</table></body></html>";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: array problem
by bory (Beadle) on Sep 12, 2003 at 13:06 UTC | |
by welchavw (Pilgrim) on Sep 12, 2003 at 15:47 UTC | |
by LordWeber (Monk) on Sep 12, 2003 at 13:48 UTC |