Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^8: Fold a list using map splices

by Anonymous Monk
on Apr 12, 2007 at 13:00 UTC ( #609655=note: print w/replies, xml ) Need Help??


in reply to Re^7: Fold a list using map splices
in thread Fold a list using map splices

#!/usr/bin/perl use strict; use warnings; use Data::Dumper; my $SPLITSIZE = 1 + int rand(6); my $len = int rand(20); printf "SPLITSIZE=%d, len=%d\n", $SPLITSIZE, $len; my @list = 1..$len; @list = map[splice @list, 0, $SPLITSIZE], 0..$#list/$SPLITSIZE; print Dumper(\@list);

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (7)
As of 2021-04-15 18:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?