Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!jpl-devvax!lwall From: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Newsgroups: comp.lang.perl Subject: Re: Scheme in Perl? (sp?): The Blurb. Message-ID: <10478@jpl-devvax.JPL.NASA.GOV> Date: 20 Nov 90 18:43:02 GMT References: <108984@convex.convex.com> Reply-To: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Organization: Jet Propulsion Laboratory, Pasadena, CA Lines: 21 In article <108984@convex.convex.com> tchrist@convex.COM (Tom Christiansen) writes: : In article flee@guardian.cs.psu.edu (Felix Lee) writes: : > Another headache was a phenomenon I call "variable suicide". Consider : > the following Perl fragment: : > sub add { local($a, $b) = @_; return $a + $b; } : > $a = 2; : > print &add(40, $a); : > This prints "80", instead of "42". It's a nasty bit of interaction : > between local() and @_. To avoid it, sp? is sprinkled with code like : > local(@sip) = @_; : > local($a, $b, $c) = @sip; : : This is truly unsettling to me. I hope Larry declares it a bug and fixes : it. Or declares both of us confused. To me a program shouldn't have to : know anything about a library routine's choice identifiers. It's definitely a bug. The trouble is that there's an easy but expensive fix, and a hard but inexpensive fix, and I'm like the donkey stuck between two bales of hay. I suppose I should do the easy one as a stopgap... Larry