Well, it's highly non-portable, but on linux, you can find this by looking on the proc filesystem and traversing a symlink. You can find the file name of the file to which STDOUT is attached by
readlink "/proc/$$/fd/1";. Demonstrated as:
[me@host]$ perl -le 'my $outputfile = readlink "/proc/$$/fd/1"; print
+STDERR $outputfile;' > t1
/home/me/t1
[me@host]$
That is... look into this process (/proc/$$), examine its filehandles (/proc/$$/fd). In particular, look at its filehandle number 1 (the fileno of STDOUT). This will be a symlink to the actual file that STDOUT is opened to (hence the readlink).
------------
:Wq
Not an editor command: Wq