Re: Permutations.
[email protected] ((Ton Hospel))
| Newsgroups | perl.golf |
|---|---|
| Organization | lunix confusion services |
| Message-ID | <[email protected]> |
In article <[email protected]>, Eugene van der Pijll <[email protected]> writes: > perl -lne'sub a{print+local$*=$*.shift,a(@_)for(1)x@_};a/./g' > > is the golf version. This one takes input from STDIN, as requested. > Same output, different order: > > perl -Xlne'sub a{print+local$*=pop.$*,a(@_)for(1)x@_};a/./g' > Or, assuming a restricted character set: -ln s/./{$&,}/g;print for<$_ >