use Win32::Perms; my $file = new Win32::Perms('lock.tmp'); $file->Remove(-1); $file->Set(); $file->Close();