in reply to Spaces between outputs.

Try print "$i ";.

Cheers,

JohnGG