Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!newstop!male!anywhere.EBay.Sun.COM!me From: me@anywhere.EBay.Sun.COM (Wayne Thompson - IR Workstation Support SE) Newsgroups: comp.lang.perl Subject: Re: Returning two lists Message-ID: <6010@male.EBay.Sun.COM> Date: 3 Apr 91 13:34:07 GMT Sender: news@male.EBay.Sun.COM Lines: 35 --- Alain Brossard writes --- 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 ----------------------------- You could return enough information to decompose the lists... return (scalar(@list), @list, @whiteouts); Then recompose them on receipt... @_ &search(....); @whiteouts = splice (@_, shift (@_)); @list = @_; Wayne