Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

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,

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://469516]
and dust plays in a shaft of sunlight...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2017-10-23 00:31 GMT
Find Nodes?
    Voting Booth?
    My fridge is mostly full of:

    Results (275 votes). Check out past polls.