Once you run
chmod in a shell with more permissive setting than =u+rw/0600 (which is the permissions
File::Temp uses when creating a temp file), the temp file is insecure. So if you're OK with that approach, ignore the "maximum security" recommendation and follow the same steps in Perl, i.e. use the filename. You can't
rename a filehandle.
Fcntl is mentioned for "passing it [the file descriptor] to another process". You don't need it for chmod or rename.
map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]