for my $file (qw(files.txt data.txt)) { unlink $file if -f $file; die "Unable to unlink '$file': $!" if -f $file; }