home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / perl / 5646 < prev    next >
Encoding:
Text File  |  1992-08-31  |  1.6 KB  |  40 lines

  1. Newsgroups: comp.lang.perl
  2. Path: sparky!uunet!usc!wupost!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!news.cs.indiana.edu!umn.edu!seasnake.micro.umn.edu!moses
  3. From: moses@seasnake.micro.umn.edu (Matthew E. Moses)
  4. Subject: Clearing a list
  5. Message-ID: <1992Sep1.020252.1026@news2.cis.umn.edu>
  6. Sender: news@news2.cis.umn.edu (Usenet News Administration)
  7. Nntp-Posting-Host: seasnake.micro.umn.edu
  8. Organization: University of Minnesota, Computer Science
  9. Date: Tue, 1 Sep 1992 02:02:52 GMT
  10. Lines: 28
  11.  
  12. Can anyone forward some hints on clearing a list?  I was modifying one of the 
  13. examples to load and sort a file.  I wrote it as a subprocess and when it gets
  14. called the second time it tacks new items onto the list instead of replacing 
  15. old ones.  Here is a sample piece:
  16.  
  17.  
  18.         while(<MAILLOG>)
  19.         {
  20.                 select(MAILLOG);
  21.                 $username = $_;
  22.                 $name = $username;
  23.                 $name_list{$name} .= $username;
  24.         }
  25.         close(MAILLOG);
  26.  
  27.  
  28. Any tips are appreciated.
  29.  
  30. *******************************************************************************
  31. * Matthew E. Moses *            __O         * "How many times do you     *
  32. *  U of Minnesota  *          _ \<,_         * hear it? It goes on all    *
  33. *            *         (_)/ (_)         * all day long everyone      *
  34. *  CIS Consultant  * moses@mermaid.micro.umn.edu * knows everthing and no     *
  35. *  ACM Sys Admin   * moses@donald.cs.umn.edu     * one's ever wrong"          *
  36. *  Air Force ROTC  * mmoses@epx.cis.umn.edu      * -Show Don't Tell- by RUSH  *
  37. *******************************************************************************
  38.  
  39.   
  40.