laziness, impatience, and hubris | |
PerlMonks |
Re: In What basis the subroutine return values assign to variables ?by FunkyMonk (Chancellor) |
on Jul 30, 2007 at 10:38 UTC ( [id://629521]=note: print w/replies, xml ) | Need Help?? |
|| is causing get_price_floor() to be evaluated in scalar context. A list eg (10, 8), when evaluated in scalar context, returns the last element, 8. That's what's assigned to $price, while $floor is left undefined. Simple solution: get rid of || 0 BTW, do you know what & does to a subroutine call? If you don't (and I don't believe you do), don't use it. Just call your subroutine without it:
In Section
Seekers of Perl Wisdom
|
|