Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: All possible number combinations in perl

by brx (Pilgrim)
on Jun 08, 2012 at 09:40 UTC ( [id://975127]=note: print w/replies, xml ) Need Help??


in reply to All possible number combinations in perl

sub mklist { my $num = shift; return "1" if $num == 1; return ($num,(map {$_,$_.$num} mklist($num-1))); } print join "\n", mklist(5); print "\n"; __END__ 5 4 45 3 35 34 345 2 25 24 245 23 235 234 2345 1 15 14 145 13 135 134 1345 12 125 124 1245 123 1235 1234 12345

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2024-04-16 17:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found