home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!gatech!bloom-beacon!eru.mt.luth.se!lunic!sunic!aun.uninett.no!nuug!nntp.uio.no!nntp.uio.no!aas
- From: aas@rosmer.nr.no (Gisle Aas)
- Newsgroups: comp.lang.perl
- Subject: Re: randomize.c
- Message-ID: <AAS.92Aug31133620@rosmer.nr.no>
- Date: 31 Aug 92 12:36:20 GMT
- References: <Btrt40.G6o@zardoz> <Bts28y.DJA@rahul.net>
- Sender: news@ulrik.uio.no (Mr News)
- Reply-To: Gisle.Aas@nr.no
- Organization: Norwegian Computing Centre, Oslo, Norway
- Lines: 14
- In-Reply-To: dhesi@rahul.net's message of Sun, 30 Aug 1992 03:41:21 GMT
- Nntp-Posting-Host: rosmer.nr.no
-
- In article <Bts28y.DJA@rahul.net> dhesi@rahul.net (Rahul Dhesi) writes:
-
- > >The following short C program reads in lines from stdin, randomizes
- > >their order, and then writes out the newly ordered lines to stdout.
- >
- > I couldn't resist rewriting it in perl.
- >
- > [lots of lines deleted]
-
- Why not: perl -e '@l=<>;print splice(@l,rand($#l),1) while @l'
- --
- Gisle Aas | snail: Boks 114 Blindern, N-0314 Oslo, Norway
- Norsk Regnesentral | X.400: G=Gisle;S=Aas;O=nr;P=uninett;C=no
- voice: +47-2-453561 | inet: Gisle.Aas@nr.no
-