in reply to postincrement bug(?) in for

Remember that you can print to filehandles stored in scalars: open my $output, '>', 'outfile.txt'; print $output 'foo';

In your first example, perl is parsing $i as being a filehandle where output should be directed, which then makes the ++ operator the output which should be printed there. But print ++ for 1 is not valid, producing the syntax error you received:

$ perl -e 'print ++ for 1' syntax error at -e line 1, near "++ for "

In the second example, $i++ is unambiguous, because you can't increment a filehandle.