in reply to Tieing a local filehandle

Your two examples produce the same output for me (v5.8.4 i386-linux-thread-multi). You might want to search perldeltas for word of this fix/change (I didn't find anything clearly pointing to it in RFC: perlfeaturedelta, but it looks like local+tie interaction has been scrutinized throughout the 5.8 sequence). It's a bummer for you, since this change and the new open usage in BrowserUk's suggestion both were added after your perl version. I wonder if it's possible to subclass IO::Scalar and somehow get the object to untie itself upon DESTROY...

The output record separator thing seemed weird to me at first too. But I got to thinking that for tied filehandles, READLINE has to manually deal with $/. Perhaps its for consistency that PRINT should deal with $\ manually as well. Also for some applications of tied filehandles (when they are not really performing a normal "filehandlish" function), having $\ automatically appended might not make any sense. In this case, I'd email the IO::Scalar maintainer and ask for the output separator to be honored by PRINT.

Update: Also a reason for not automatically handling $\ is that you can pass multiple args to print, which are sent over raw to the tied PRINT method. Perl wants you to be able to use these multiple args to do anything you like, not just join them on $, (like a normal print). How exactly to automatically tack on $\ when there are multiple args to print is a problem!

blokhead