http://qs321.pair.com?node_id=11128970


in reply to Three argument version of open '>-' (updated)

If the OS provides it perhaps explicitly opening /dev/stdout as the filename? Or maybe no because that's going to behave like your "prints OK" block because it'd return a new descriptor on the device.

Slightly ebil but maybe open( my $output, ">>&=", STDOUT->fileno ) would get it? (I want to say that should create a new handle instance pointing to the same underlying descriptor which seems to be what >- was doing).

The cake is a lie.
The cake is a lie.
The cake is a lie.