in reply to Small Calculator!

#!/usr/bin/perl -wnl $_=eval();print;
This will do the work!

Replies are listed 'Best First'.
Re: Re: Small Calculator!
by defyance (Curate) on Oct 04, 2002 at 19:23 UTC
    #!/usr/local/bin/perl -w $|++; print "calc: "; print eval, "\ncalc: " while chomp( $_ = <STDIN> );
    Pretty sure this code is simmilar to some other code I found round here somewhere, heh. It should do the job for you..

    -- Can't never could do anything, so give me and inch, I'll make it a mile.