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

Re: Re: Re: Making little array babies

by jdporter (Paladin)
on Apr 13, 2004 at 13:51 UTC ( [id://344711]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Making little array babies
in thread Making little array babies

Well, the direct equivalent* of mine, above, would be:
(* other than scoping issues of $i)

my $i = 0; while ( $i <= $#a ) { push @b, [ @a[ $i .. $i+$n-1 ] ]; } continue { $i += $n; }
Thing I don't like about yours is the incessant multiplication by $n.

jdporter
The 6th Rule of Perl Club is -- There is no Rule #6.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2024-04-24 18:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found