in reply to Simple syntax error?
Not the problem you were asking about, but: $#letters + 1 is equivelent to @letters in a scalar context and the latter is probably a little clearer.