[ol][li]You don't have a closing
} on the for loop in the original post.[/li][li]Why do you have
$$vv in the print line instead of
$vv?
use strict; and
use warnings; are your friends, and would have shown the use of the uninitialised variable.[/li][li]If you use
@f in a scalar context (as you are doing above), you don't need the explicit
scalar keyword, Perl will figure it out.[/li][li]If you had used
< instead of
<= on the for loop condition, you wouldn't need to subtract 1 from $n to do the comparison.[/li][li]Normally you see
$i++ rather than
++$i on the for loop.[/li][li]Travis' solution is a lot cleaner, as you don't need the loop counter at all, and even the
$vv is redundant as
$_ will hold the same value if you code
for (@f) { ... }.[/li][li]Start by getting your loop working as Travis suggests, and then add the window dressing of the surrounding HTML afterwards.[/li][li]Consider getting rid of all the embedded formatting and put it in a style sheet (*.css file) instead. It will clean up your code massively, not to mention allowing you to re-skin the whole site at a whim AND support disabled users more easily.[/li][/ol]
Steve
[small]"Every program can be reduced by one instruction, and every program has at least one bug. Therefore, any program can be reduced to one instruction which doesn't work."
(Object:
erlDesignPatterns)[/small]