in reply to Simple Calculator

That's pretty cool, here's a simple calculator too ;-)
#!/usr/local/bin/perl -w
use strict; $|++; print "> ";
print eval, "\n> " while chomp( $_ = <STDIN> );
Enjoy!
--
Casey

Replies are listed 'Best First'.
Re^2: Simple Calculator
by jdhedden (Deacon) on Jun 13, 2005 at 19:11 UTC
    This can be done in a one-liner:
    perl -ple '$_ = "> " . eval'
    which you can add to your .bashrc file using:
    alias calc='perl -ple '\''$_ = "> " . eval'\'''
    You can exit the loop with ^D.

    Remember: There's always one more bug.