use strict; use warnings; open(my $fh,'>:unix','abc.txt') or die $!; print $fh "one line\n" close $fh; # No error message on unlink unlink 'abc.txt' or die $!;