Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!decwrl!mcnc!gatech!usenet.ins.cwru.edu!ncoast!allbery From: allbery@NCoast.ORG (Brandon S. Allbery KB8JRR/AA) Newsgroups: comp.lang.perl Subject: Re: Returning two lists Message-ID: <1991Apr7.193502.18978@NCoast.ORG> Date: 7 Apr 91 19:35:02 GMT References: <1991Apr3.233558.11641@uvaarpa.Virginia.EDU> Reply-To: allbery@ncoast.ORG (Brandon S. Allbery KB8JRR/AA) Followup-To: comp.lang.perl Organization: North Coast Public Access Un*x (ncoast) Lines: 37 As quoted from <1991Apr3.233558.11641@uvaarpa.Virginia.EDU> by worley@compass.com (Dale Worley): +--------------- | From: brossard@sic.epfl.ch (Alain Brossard EPFL-SIC/SII) | | return ( @list, @whiteouts ); | | Since Perl has no arrays of arrays, the (...) operator (in an array | context) concatenates any arrays that it is given. +--------------- Well, there's always: $gensym00000000 = 'gensym00000000'; sub gensym { ++$gensym000000000; } sub foo { local(*X, *Y) = (&gensym, &gensym) ... /* use @X and @Y */ (*X, *Y); } ... /* main program */ undef @arr1; undef @arr2; (*arr1, *arr2) = &foo(...); (But if you don't understand it, you almost certainly don't want anything to do with it: it's major black magic.) ++Brandon -- Me: Brandon S. Allbery Ham: KB8JRR/AA on 2m, 220, 440, 1200 Internet: allbery@NCoast.ORG (QRT on HF until local problems fixed) America OnLine: KB8JRR // Delphi: ALLBERY AMPR: kb8jrr.AmPR.ORG [44.70.4.88] uunet!usenet.ins.cwru.edu!ncoast!allbery KB8JRR @ WA8BXN.OH