On Mon, Sep 08, 2003 at 03:50:25PM -0400, Stephen Gilbert wrote: > I know I saw something like this in the past I just can't find it. Anyone got any > ideas? > > perl -e 'print eval { @ARGV }, "\n"' 5 + 5 > > it should be able to take any perl arithmetic operator. so: > > perl -e 'print eval { @ARGV }, "\n"' 840928302840982 / 74098374 > > or > > perl -e 'print eval { @ARGV }, "\n"' 79872593 * 67 > > This code does not work, but I'm sure there is something simple, I know I've seen it.
Try: perl -le 'print eval "@ARGV"' 5 + 5 You'll need to be careful with shell metacharacters: perl -le 'print eval "@ARGV"' '79872593 * 67' -- Paul Johnson - [EMAIL PROTECTED] http://www.pjcj.net -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]