home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.perl
- Path: sparky!uunet!indetech!cirrus!dhesi
- From: dhesi@cirrus.com (Rahul Dhesi)
- Subject: Re: randomize.c
- Message-ID: <1992Aug31.183903.4143@cirrus.com>
- Sender: news@cirrus.com
- Organization: Cirrus Logic Inc.
- References: <Btrt40.G6o@zardoz> <Bts28y.DJA@rahul.net> <AAS.92Aug31133620@rosmer.nr.no>
- Date: Mon, 31 Aug 1992 18:39:03 GMT
- Lines: 13
-
- In <AAS.92Aug31133620@rosmer.nr.no> aas@rosmer.nr.no (Gisle Aas) writes:
-
- >Why not: perl -e '@l=<>;print splice(@l,rand($#l),1) while @l'
-
- I considered using splice and decided not to take the risk of a
- possibly inefficient implementation. Later I was told that the perl
- book already has such a program.
-
- Just how efficient is splice? I guess it depends on whether arrays in
- perl are internally implemented as linked lists.
- --
- Rahul Dhesi <dhesi@cirrus.com>
- also: dhesi@rahul.net
-