AFAIR, open FILE, ">$some_file" will fail if some other process already has the file open for writing, thus you could eval the call (to open) and proceed based on the caught exception - if any.
A user level that continues to overstate my experience :-))
Comment on Re: How to identify a file is in readonly mode
-w tests to see if the script is capable of writing (to) the file i.e. using the statically defined permissions on the file, not dynamically i.e. run-time determination, as required by the OP.
A user level that continues to overstate my experience :-))