in reply to Tieing a local filehandle
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
|
|---|