Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: solving a quadratic equation

by RMGir (Prior)
on Dec 08, 2009 at 12:46 UTC ( #811728=note: print w/replies, xml ) Need Help??


in reply to solving a quadratic equation

You've got a couple of different problems going on here.

I'd suggest running your code under perl -d (the debugger) and using the "b" command to set breakpoints at the line where you're closing FH and doing

p @temp
That will show you what @temp contains. Hint, it's not what you expect :)

Also, you should put a breakpoint in quadratic in the line that returns the result. Check out the values of $a, $b, and $c - they're also not what you expect, because @temp isn't what you expected, and also because you're passing \@temp (a reference to an array) but then accessing @_, which will only contain one element, that reference.


Mike

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://811728]
help
Chatterbox?
[choroba]: Yeah, my wife sent me some pictures of the children yesterday, and there was snow all around. 10 days in Saigon and I totally forgot what weather they have back there.
[stevieb]: We've had so much snow here this year that the whole area is pretty much under constant avalanche warnings (and avalanches pretty much daily all over the place)

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (11)
As of 2017-02-23 17:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (350 votes). Check out past polls.