in reply to Re^5: chmod in perl
in thread chmod in perl

Either ignore that error,

my $filename = q{deletefiles.txt}; chmod 0777, $filename or $!{ENOENT} or die $!; open my $OUTPUT, q{+>}, $filename or die $!;

Or change the permissions after creating the file.