http://qs1969.pair.com?node_id=470537


in reply to Favourite One-liners?

I always use Perl when I need to do some calculation.

$ perl -le 'print <arithmetic expression here>'

The debugger is handy for iterative calculations:

$ perl -de0

Update - tip: Be careful with constructs like:

print (5 + 4) * 3;

This is equivalent to (print 5 + 4) * 3, probably not what you want.