Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
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
Replies are listed 'Best First'.
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 chanting in the Monastery: (11)
As of 2015-07-30 21:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (273 votes), past polls