Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: how many elements in array?

by Anonymous Monk
on Apr 18, 2005 at 13:20 UTC ( #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? | Other CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2023-10-04 07:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?