someone help me out with the syntax error on line 18 please?
Code:
#!/usr/bin/perl
use strict;
my $FileName = 'file.txt'; # Modify file name as needed.
my(@List,%List,@NewList)= ();
sub Abandon
{
print join '
',@_;
exit;
} # sub Abandon
print "Content-type: text/plain\n\n";
Abandon("Unable to read file $FileName") unless open R,"<$FileName";
@List = ;
close R;
Abandon("Unable to create temporary file ${FileName}.tmp.txt") unless open W,">${FileName}.tmp.txt";
for(@List) { print W $_; }
close W;
for(@List)
{
next if $List{$_};
$List{$_}++;
push @NewList,$_;
}
Abandon('Something wrong.',"Backup file is ${FileName}.tmp.txt") unless open W,">$FileName";
for(@NewList) { print W $_; }
close W;
unlink "${FileName}.tmp.txt";
print 'D O N E';