I needed to get the sum of a lot of figures from STDIN (one number per line), didn't find a standard unix tool for doing that (if anyone knows one, let me know, I'm still interested). Therefore I used the new powerfull PHP 5 commandline options:
cat figures | php5 -B '$sum = 0;'
-R'$sum += $argn;' -E 'echo $sum;'
and done. See man php for more details.