http://www.perlmonks.org?node_id=393131


in reply to nested combinations: algorithm advice?

#!/usr/bin/perl -lanF_ "@F"=~$r[$_-1]&&print"$.,$_"for 1..@r;$_="{@F}.+{@F}";y/ /,/;push@r,jo +in'|',glob

Replies are listed 'Best First'.
Re^2: nested combinations: algorithm advice?
by Jasper (Chaplain) on Sep 23, 2004 at 09:44 UTC
    #!/usr/bin/perl -lapF_ for$p(@p){$;.="$_ and $p "if 1<grep"@F"=~$_,split/_/,$p}push@p,$_}{$_=$
      What?! No glob? Bah! Ameteur... :-)

      ps. I believe you are missing a semicolon.