I do not think you are looking at a scope issue. You are including code in the defenition of your for loop. Try this:
for($i; $i < 50; $i++)
{
$j = $i + 100;
$j++;
print "i=$i j=$j hello!\n";
}
Another question would be why do you have
$j = $i + 100; and
$j++;
instead combine them the following way
$j = $i + 101;