http://qs321.pair.com?node_id=665305


in reply to Golf/Perlish solution to this problem?

Without going for total golf (tempting, but I can resist) I'd still write something like:
my $n = 8; my $i = 1; my @array; push @array, $n--, $i++, $i++, $n-- while $n > $i; print "@array";
This breaks the rule of not increasing/decreasing the same variable twice in the same statement, but in practise this will work in all versions of perl5. Notice that in fact it wouldn't work if pre-increment/pre-decrement had been used instead of post-increment/post-decrement