common/tools/sortUnique.pl
author Simon Howkins <simonh@symbian.org>
Wed, 27 Oct 2010 16:22:14 +0100
changeset 1316 0b4a09013baf
parent 246 4f2482f1dd48
permissions -rw-r--r--
Added copyright messages

#!perl -w
# Copyright (c) 2009 Symbian Foundation Ltd
# This component and the accompanying materials are made available
# under the terms of the License "Eclipse Public License v1.0"
# which accompanies this distribution, and is available
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
#
# Initial Contributors:
# Symbian Foundation Ltd - initial contribution.
# 
# Contributors:
#
# Description:
# Sorts the input, removes duplicates, and outputs it

use strict;

# Read it
my @content = <>;

# Sort it, and grep to remove duplicates
my $previous = "\n\n";
@content = grep {$_ ne $previous && ($previous = $_, 1) } sort @content;

# Write it
print @content;