On May 10, Jonathan E. Paton said:

>> I meant to convert the email address to lowercase...
>
>Wonder where you got that idea?  ;-)

Oh, hush. ;)  We all had the same answers, more or less.

>Looks like that question has been quite well covered.  Under Unix, my simple
>version can be reduced to:
>
>cat list.current | perl -ne 'print if not $seen{split'|'}++' > list.new

Not so.  First, you've got quote problems.  Then you need to backslash the
|.  Then you need to turn

  split /\|/

into

  (split /\|/)[3]

because $hash{ split ... } calls split() in scalar context, and that ain't
no good here.

  perl -ne '!$seen{(split/\|/)[3]}++&&print' input > output

-- 
Jeff "japhy" Pinyan      [EMAIL PROTECTED]      http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
** Look for "Regular Expressions in Perl" published by Manning, in 2002 **
<stu> what does y/// stand for?  <tenderpuss> why, yansliterate of course.
[  I'm looking for programming work.  If you like my work, let me know.  ]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to