Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!samsung!zaphod.mps.ohio-state.edu!uwm.edu!lll-winken!elroy.jpl.nasa.gov!jpl-devvax!lwall From: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Newsgroups: comp.lang.perl Subject: Re: Function return type conversion bug Message-ID: <7221@jpl-devvax.JPL.NASA.GOV> Date: 28 Feb 90 22:57:25 GMT References: <1990Feb28.130139.2942@axion.bt.co.uk> Reply-To: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Organization: Jet Propulsion Laboratory, Pasadena, CA Lines: 18 In article <1990Feb28.130139.2942@axion.bt.co.uk> nwinton@axion.bt.co.uk writes: : This is a bit of a strange one. Under certain circumstances, perl seems : to fail to convert an integer return value into a string. I'm afraid : I haven't been able to narrow it down too closely, but attached is a : fairly small program that exercises the bug. Fixed. Actually, it didn't have anything to do with whether the value was numeric, but with whether the value was clobbered in restoring a local(). Since the value for $r . '' is stored in a different place than the value of $r itself, it didn't get clobbered on the return. The bug was hidden before this because it didn't show up unless a routine mixed returns and non-returns. Say "return $r;" also worked around the problem. Larry