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

Re: Syntactically cool list of lists

by druud (Sexton)
on Dec 22, 2006 at 17:07 UTC ( #591359=note: print w/ replies, xml ) Need Help??


in reply to Syntactically cool list of lists

$ perl -MData::Dumper -wle ' $s = 5; @a = (1,5,7,9,32,197,8,4,5); $e=int $#a/$s; @b = map {$_*=$s; [@a[$_..($_+$s>$#a?$#a:$_+$s-1)]]} 0..$e; print Dumper \@b '
$VAR1 = [ [ 1, 5, 7, 9, 32 ], [ 197, 8, 4, 5 ] ];

-- 
Ruud


Comment on Re: Syntactically cool list of lists
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (12)
As of 2015-07-30 12:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (271 votes), past polls