Obfuscation to delight and amaze.
#!/usr/bin/perl -nl use re 'eval';local$"; /@{[map'(?:(.)|.)',1..length]}(?{print+join'',map$$_,1..length})(?!)/;
UPDATE: sorry, it should have #!/usr/bin/perl -nl at the top. I'm a silly person.

japhy -- Perl and Regex Hacker

Replies are listed 'Best First'.
Re (tilly) 1: (Fixed) Mr. Regex Strikes Again!
by tilly (Archbishop) on May 15, 2001 at 14:32 UTC
    In the future please note when things are only supposed to run under 5.6.x. There is no output under 5.005.
      D'oh, yeah, because of (?{ ... }). Sigh. Ok, I'm saying what the program does, since it's been so much of a hassle already. It prints all sequences (not necessarily continuous) of a string:
      input: abcd output: a b c d ab ac ad bc bd cd abc abd acd bcd abcd


      japhy -- Perl and Regex Hacker
        Actually, there's also an empty line when you do this. Because of that, a better way to say this is that the output is the set of all subsets of the input list where the elements in the subset follow the order from the original list. This includes the trivial solutions of the empty set and the original set, in addition to all other non-trivial solutions. So that's some nice golfin' there :-)
        Dr. Michael K. Neylon - mneylon-pm@masemware.com || "You've left the lens cap of your mind on again, Pinky" - The Brain
Re: Mr. Regex Strikes Again!
by Masem (Monsignor) on May 15, 2001 at 04:11 UTC
    Under 5.6.0 on Linux, this does nothing (nothing is captured by the output as well).

    It *looks* amazing, to say the least... :-)

    Update Yup, the fix works. :-)


    Dr. Michael K. Neylon - mneylon-pm@masemware.com || "You've left the lens cap of your mind on again, Pinky" - The Brain