Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
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 imbibing at the Monastery: (10)
As of 2014-10-24 18:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (134 votes), past polls