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

Re: Debug basic calculator syntax

by kirbyk (Friar)
on Jun 23, 2005 at 21:07 UTC ( #469516=note: print w/ replies, xml ) Need Help??


in reply to Debug basic calculator syntax

The first thing that jumps out is the '=' inside the if clauses. You really want to use 'eq' for string comparisons and == for number comparisons. What you're doing is assigning 'y' to $add.

It also might help if you said what happened when you tried to run it. And include the !# line, so we can tell you to add a -w to it, so perl will give you extra helpful hints.

In general, this is going to raise people's "Asking for help with homework" flag, so you'll get more help if you show what you've tried to do to debug it, and maybe why you think the line that's broken should work. People like to educate those striving to learn, while are annoyed at giving people answers if they just want to avoid learning the language in the first place.

-- Kirby, WhitePages.com


Comment on Re: Debug basic calculator syntax

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (13)
As of 2014-07-30 11:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (230 votes), past polls