common/tools/sortUnique.pl
author Simon Howkins <simonh@symbian.org>
Tue, 25 Aug 2009 11:06:23 +0100
changeset 380 d4dac57985d9
parent 246 4f2482f1dd48
child 1284 0b4a09013baf
permissions -rw-r--r--
Bug 299 populateziptemplate.pl aborts if it cannot determine the license for a source component Changed so that even if it encounters an error it will still generate the output file before it exits with a failure error code.

#!perl -w
use strict;
# Sorts the input, removes duplicates, and outputs it

# 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;