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

  1. Newsgroups: comp.lang.perl
  2. Path: sparky!uunet!munnari.oz.au!cs.mu.OZ.AU!munta.cs.mu.OZ.AU!fjh
  3. From: fjh@munta.cs.mu.OZ.AU (Fergus James HENDERSON)
  4. Subject: Re: randomize.c
  5. Message-ID: <9224509.16563@mulga.cs.mu.OZ.AU>
  6. Sender: news@cs.mu.OZ.AU
  7. Organization: Computer Science, University of Melbourne, Australia
  8. References: <Btrt40.G6o@zardoz> <Bts28y.DJA@rahul.net> <AAS.92Aug31133620@rosmer.nr.no>
  9. Date: Mon, 31 Aug 1992 23:15:32 GMT
  10. Lines: 14
  11.  
  12. aas@rosmer.nr.no (Gisle Aas) writes:
  13.  
  14. >Why not:    perl -e '@l=<>;print splice(@l,rand($#l),1) while @l'
  15.  
  16. Because it's not random?
  17.  
  18. Try
  19.              perl -e 'srand;@l=<>;print splice(@l,rand($#l),1) while @l'
  20.  
  21. -- 
  22. Fergus Henderson             fjh@munta.cs.mu.OZ.AU      
  23. This .signature virus is a self-referential statement that is true - but 
  24. you will only be able to consistently believe it if you copy it to your own
  25. .signature file!
  26.