Re: Permutations.

2002-12-11 Thread Paul Johnson
Tor Hildrum said: > I found this on the perl-beginner list: > Perl -e > '*,=sub{print+local$*=$*.$_[$_],$/,&,(@_[1+$_..$#_])for$#..$#_};&,(1..5)' > > By Paul Johnson, which isn't to shabby, but not really up to specs. At first I thought "What? I posted that to the _beginners_ list?", but then I

Re: Permutations.

2002-12-11 Thread Wladimir Palant
> I found this on the perl-beginner list: > Perl -e > '*,=sub{print+local$*=$*.$_[$_],$/,&,(@_[1+$_..$#_])for$#..$#_};&,(1..5)' > > By Paul Johnson, which isn't to shabby, but not really up to specs. > > Anyone? Of course :) Perl -e "sub a{print+local$*=$*.shift,$/,a(@_)for$#..$#_};a(1..3)" Wlad

Re: Permutations.

2002-12-11 Thread Wladimir Palant
Perl -e 'sub a{print+local$*=$*.shift,$/,a(@_)for(1)x@_};a(1..5)'