Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: how many elements in array?

by Anonymous Monk
on Apr 18, 2005 at 13:20 UTC ( [id://448842]=note: print w/replies, xml ) Need Help??


in reply to how many elements in array?

my $c1 = 0; $c1 += 1 for @array; my $c2 = grep {$_ || !$_} @array; my $c3 = 0; L1: goto L2 unless @array % 2; $c3++; pop @array; L2: goto L3 unless @array; $c3 *= 2; splice @array, 0 @array / 2; goto L1; L3: my $c4 = do {local $" = "+"; eval "@{[map {1} @array]}"}; my $c5 = length join "", map " ", @array; use POSIX 'ceil'; my $c6 = ceil((length join " ", map "", @array)/2); my $c7 = 0; $c7++, shift @array while @array;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://448842]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (1)
As of 2024-04-18 23:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found