changeset 246 | 4f2482f1dd48 |
child 1316 | 0b4a09013baf |
245:2719a5d09e27 | 246:4f2482f1dd48 |
---|---|
1 #!perl -w |
|
2 use strict; |
|
3 # Sorts the input, removes duplicates, and outputs it |
|
4 |
|
5 # Read it |
|
6 my @content = <>; |
|
7 |
|
8 # Sort it, and grep to remove duplicates |
|
9 my $previous = "\n\n"; |
|
10 @content = grep {$_ ne $previous && ($previous = $_, 1) } sort @content; |
|
11 |
|
12 # Write it |
|
13 print @content; |