in reply to one line for combining line

If you don't care about the order of the output, you could just use a hash instead of the Perl6::Junction CPAN module. How's this for ugly...
perl -ne '$h{$_}++}{print for keys%h' tt.txt

Update: not to mention sort...

sort -u tt.txt

Replies are listed 'Best First'.
Re^2: one line for combining line
by xiaoyafeng (Deacon) on Jul 06, 2010 at 04:03 UTC
    Obfuscated code for me, absolutely! what does }{ mean? help! ;)




    I am trying to improve my English skills, if you see a mistake please feel free to reply or /msg me a correction

      What comes after ends up outside the -n loop.
      $ perl -MO=Deparse -ne'f()' LINE: while (defined($_ = <ARGV>)) { f(); } -e syntax OK $ perl -MO=Deparse -ne'f() }{ g()' LINE: while (defined($_ = <ARGV>)) { f(); } { g(); } -e syntax OK
        Great! I've never known this module!




        I am trying to improve my English skills, if you see a mistake please feel free to reply or /msg me a correction