Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: How to return a list using recursion?

by BrowserUk (Pope)
on Aug 07, 2012 at 04:53 UTC ( #985879=note: print w/replies, xml ) Need Help??


in reply to How to return a list using recursion?

sub chunks{ my( $n, @in ) = @_; join ",\n", map join(' ', splice @in, 0, $n), 0 .. $#in / $n; };; print chunks( 3, 'a'..'z' );; a b c, d e f, g h i, j k l, m n o, p q r, s t u, v w x, y z print chunks( 10, 'a'..'z' );; a b c d e f g h i j, k l m n o p q r s t, u v w x y z print chunks( 26, 'a'..'z' );; a b c d e f g h i j k l m n o p q r s t u v w x y z print chunks( 13, 'a'..'z' );; a b c d e f g h i j k l m, n o p q r s t u v w x y z print chunks( 6, 'a'..'z' );; a b c d e f, g h i j k l, m n o p q r, s t u v w x, y z

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

The start of some sanity?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://985879]
help
Chatterbox?
[erix]: a few years ago there was suddenly the news that the Kremlin was using typewriters again. Heard nothing about it afterward
[erix]: (maybe that means it worked)
[oiskuu]: Yeah, it might work as long as there are no root exploits. ;-)
[Corion]: Also, it's much harder to leak paper sheets than it is to leak documents that are available electronically
[oiskuu]: tye, do you make use of remote logging?
[oiskuu]: erix, this gives a new definition to e-paper: something that records the pressure imprints and is bluetooh capable, looks like ordinary paper.
[oiskuu]: So to be really, really sure, you must microwave the paper before you type on it.

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (6)
As of 2017-06-23 20:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (555 votes). Check out past polls.