Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!samsung!munnari.oz.au!frankland-river!pem From: pem@frankland-river.aaii.oz.au (Paul E. Maisano) Newsgroups: comp.lang.perl Subject: Passing scalars by reference Message-ID: <1220@frankland-river.aaii.oz.au> Date: 6 Mar 90 05:04:08 GMT Organization: Australian AI Institute Lines: 22 Could someone please tell me how I can pass scalars by reference in the same way arrays are. I know I can refer to $_[nnn] like its says in the manual, but I would like to do something like: sub foo { local($x_by_ref_with_meaningful_name) = $_[0]; ... $x_by_ref_with_meaningful_name .= $foo; # update the original scalar } I tried this and it seemed to work on the first call only. Thereafter it updated a global variable called $x_by_ref_with_meaningful_name. Hopefully it's not a bug and I'm just doing something wrong. It's happening on both SUN-3's and sparcstations, pl 12. ------------------ 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