[27807] in Perl-Users-Digest
Perl-Users Digest, Issue: 9171 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Apr 18 21:05:53 2006
Date: Tue, 18 Apr 2006 18:05:09 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 18 Apr 2006 Volume: 10 Number: 9171
Today's topics:
Re: FAQ 4.41 How can I remove duplicate elements from a <rwxr-xr-x@gmx.de>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 19 Apr 2006 02:57:32 +0200
From: "Lukas Mai" <rwxr-xr-x@gmx.de>
Subject: Re: FAQ 4.41 How can I remove duplicate elements from a list or array?
Message-Id: <e241ts$upe$03$2@news.t-online.com>
robic0 schrob:
[perlfaq fullquote snipped]
>
> This may be more efficient:
>
> $lastelement = undef;
> foreach $element (sort @array)
> {
> if ($lastelement != $element) {
use warnings; use strict;
Using != with undef is a bad idea, even more so as you're apparently
dealing with numbers here: 0 == undef.
But wait, if @array contains numbers, why did you use a lexicographical
sort above?
> push @newarray, $element;
> $lastelement = $element;
> }
> }
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc. For subscription or unsubscription requests, send
#the single line:
#
# subscribe perl-users
#or:
# unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.
#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 9171
***************************************