#!/usr/bin/perl
die "File not found\n" unless -e $ARGV[0];
open(FILE, $ARGV[0]);
foreach $line () {
$DATA{lc($line)} = 1;
}
close(FILE);
die "Can't write to file $ARGV[0]\n" unless -w $ARGV[0];
open(FILE, "> $ARGV[0]");
foreach $line (sort (keys %DATA)) {
print FILE $line;
print FILE uc($line);
}
close(FILE);
|