Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sdd.hp.com!decwrl!deccrl!bloom-beacon!eru!hagbard!sunic!mcsun!cernvax!chx400!chx400!sicsun!sic!brossard From: brossard@sic.epfl.ch (Alain Brossard EPFL-SIC/SII) Newsgroups: comp.lang.perl Subject: Returning two lists Message-ID: <1249@sicsun.epfl.ch> Date: 2 Apr 91 18:08:06 GMT Sender: news@sicsun.epfl.ch Lines: 23 I want to return two lists from a subroutine (which is recursive). (I'm using perl 4.000). My code is the following: sub search { local( $dir, $start, @list, @files, $file, @mem_list, @whiteouts, @rtn_list, @rtn_wo ) = @_; (...) return ( @list, @whiteouts ); # also tried # return ( (@list), (@whiteouts) ); } (@list, @whiteouts) = do search( $dir, '' ); The only thing I get is that on return, @list always contains the union of the returned lists. Any suggestions? Alain Brossard