From: Eric Mahurin Date: 2005-10-06T05:31:50+09:00 Subject: Re: One-liner removing duplicate lines Here is a pretty close translation that does what you want: ruby -ne 's||={};s[$_]||print;s[$_]=true' --- Damien Wyart wrote: > Hello, > > Converting from Perl to Ruby, I am trying to find an > equivalent to this > Perl one-liner removing duplicate lines in a file (without > sorting it at > first) : > > perl -ne'$s{$_}++||print' infile >outfile > > I guess uniq method could be used, but I can't find how. > > > Many thanks in advance, > > -- > Damien Wyart > > __________________________________ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com