Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://469516]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2016-12-09 11:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (150 votes). Check out past polls.