perlでやってみる
perl -E '$s+=$_%2?0:$_ for 1..100;say$s'
perl -E 's/.+/$s+=$&%2?0:$&/e for 1..100;say$s'
perl -E '$"="+";$a="@{[1..100]}";$a=~s/\d+/$&%2?0:$&/eg;eval"say $a"'
perl -E '$"="+";eval"say @{[grep{$_%2==0}1..100]}";'
4つ思いついた
結論
simple is best