AIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, July 05, 2002 3:59 PM
Subject: Re: performance: pop? shift? or another way?
>
> thx to all, grep seems to be the best way to do it.
>
> greetings
> michael
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
thx to all, grep seems to be the best way to do it.
greetings
michael
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
use strict;
use warnings;
my @list = qw(0 1 1 1 0 1 0 0 1 1 0 0 0 1 0 1 0 1 1);
my @out;
@out = grep($_ != 0, @list);
foreach (@out){ print $_, "\n"; }
-Original Message-
From: Michael Rauh [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 05, 2002 4:40 PM
To: Beginners, Perl
Subject: p
Michael Rauh wrote at Fri, 05 Jul 2002 08:39:42 +0200:
> hi,
>
> say i have an unsorted (large) list of, e.g., 0's and 1's:
>
> @list = (0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, ...)
>
> i now want to remove all the zeros, using the fastest way possible. how would U do
>that?
When it is so import