Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

My permutor

by merlyn (Sage)
on Jul 25, 2000 at 07:57 UTC ( #24244=note: print w/ replies, xml ) Need Help??


in reply to RE: Re: How can I improve this?
in thread How can I improve this?

Well, since everyone is posting their permutors, here's mine:

sub permute { my $last = pop @_; unless (@_) { return @$last; } return map { my $left = $_; map "$left$_", @$last } permute(@_); }

-- Randal L. Schwartz, Perl hacker


Comment on My permutor
Download Code
Drool
by gryng (Hermit) on Jul 25, 2000 at 17:01 UTC
    Drool....

    Oh I like that.

    Mmmm,
    Gryn

Re: My permutor
by Anonymous Monk on Oct 03, 2004 at 18:45 UTC

    does this work? how do you call it?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2015-07-07 03:23 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 (87 votes), past polls