However, for your case, the last result would be an array like this
@newArray = [1,1,1,1,1,1,1,1.....]; # Seems meaningless... =)
So, I guess, the final stuff you want maybe $#newArray......
If that's your case, you may also try this :
my $true = 0; # you may set as -1 if you want the first count as 0
for (@array) { $true++ if $_ };
print $true
If you still want it as an array style with the above method :
push @newArr, 1 for (1..$count);
# The number of true values in real is $#newArr + 1
Rgds,
Connie
----- Original Message -----
From: "Michael Rauh" <[EMAIL 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]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]