Beefy Boxes and Bandwidth Generously Provided by pair Networks Frank
There's more than one way to do things
 
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 contemplating the Monastery: (13)
As of 2014-04-18 17:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (471 votes), past polls