Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

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.


Log In?

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (10)
As of 2016-10-21 11:24 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (288 votes). Check out past polls.