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.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Favourite One-liners?
by kaif (Friar) on Jun 28, 2005 at 14:21 UTC | |
by tlm (Prior) on Jul 02, 2005 at 05:07 UTC |
In Section
Meditations