#!/usr/bin/env perl # # uniqer - uniq, but removes duplicate lines in unsorted files as well # # $Id# # # memory hungry without -s ... use warnings; use strict; use Getopt::Std; my %opt; getopts( 'h?se:', \%opt ) or die "error parsing command line: $!\n"; HELP_MESSAGE() if grep { /^[h?]/ } keys %opt; sub HELP_MESSAGE { print STDERR <) { my $l = $_; eval $opt{e} if defined $opt{e}; print $l unless $seen{$_}; %seen = () if $opt{s}; $seen{$_} = 1; }