Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!samsung!munnari.oz.au!frankland-river!pem From: pem@frankland-river.aaii.oz.au (Paul E. Maisano) Newsgroups: comp.lang.perl Subject: Re: Passing scalars by reference Message-ID: <1231@frankland-river.aaii.oz.au> Date: 6 Mar 90 23:49:46 GMT References: <1220@frankland-river.aaii.oz.au> <7293@jpl-devvax.JPL.NASA.GOV> Organization: Australian AI Institute Lines: 29 Thanks for the explanation Larry. It's clear what I was doing wrong now. > : sub foo { > : local($x_by_ref_with_meaningful_name) = $_[0]; > : ... > : $x_by_ref_with_meaningful_name .= $foo; # update the original scalar > : } That was just a slip, what I meant to write was: sub foo { local(*x_by_ref_with_meaningful_name) = $_[0]; ... $x_by_ref_with_meaningful_name .= $foo; # update the original scalar } I had tried this. I was however calling foo incorrectly, as in &foo($real_name) instead of &foo(*real_name). The thing that threw me off track was that this actually works, once. I would be interested in knowing why this happens. ------------------ Paul E. Maisano Australian Artificial Intelligence Institute 1 Grattan St. Carlton, Vic. 3053, Australia Ph: +613 663-7922 Fax: +613 663-7937 Email: pem@aaii.oz.au UUCP: {uunet,mcsun,ukc,nttlab}!munnari!aaii.oz.au!pem