[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Perl Filter Demos?



Tom--

If that's the case, then you could simply do this:

#!perl -nl
print unless $s{$_}++

which doesn't care about sort order.  This is basically uniq(1) in a single
line of Perl.  In fact, this preserves the existing order in the document,
just weeding out the duplicates.  Kinda neat, but not flashy enough for a
demo.

--B
--
Webmaster/MacPerl Guru
*****************************************************
Mycoinfo, the World's First Mycology e-Journal
http://www.mycoinfo.com/
*****************************************************


----------
>From: Tom Maas <tom@grafidata.nl>
>To: "Tom Maas" <tom@grafidata.nl>, "Rich Morin" <rdm@cfcl.com>,
<macperl@macperl.org>
>Subject: Re: [MacPerl] Perl Filter Demos?
>Date: Mon, May 8, 2000, 12:05 PM
>

> :-) replying to myself...
>
> Ofcourse you may want to sort your text first using BBEdit's tools.
> That way you wil know that every line in your document wil be unique
> after running the filter.

# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org