Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Help with simple calculator script.

by cchampion (Curate)
on Oct 24, 2003 at 16:15 UTC ( #301884=note: print w/ replies, xml ) Need Help??


in reply to Help with simple calculator script.

Some Super Search digging in our code vaults gives:

HTH


Comment on Re: Help with simple calculator script.
Download Code
Re: Re: Help with simple calculator script.
by sauoq (Abbot) on Oct 24, 2003 at 22:29 UTC

    The problem with Juerd's is that it offers no error checking. This one does:

    perl -ple'$_=eval||$@||0'

    For example:

    $ perl -ple'$_=eval' 1/0
    vs.
    $ perl -ple'$_=eval||$@||0' 1/0 Illegal division by zero at (eval 1) line 2, <> line 1.

    -sauoq
    "My two cents aren't worth a dime.";
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://301884]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (11)
As of 2014-07-31 17:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (249 votes), past polls