Problems? Is your data what you think it is? | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
According to say, say is shorthand for { local $\ = "\n"; print LIST }. Consistent with that perltie says that the PRINT method of a tied handle gets called for both print $some_tied_handle and say $some_tied_handle:
However, it seems that when a handle is tied, PRINT is called but local $\="\n" isn't done beforehand. Instead, whatever value of $\ was available before the call to say is used and never overridden. Here is some sample code that demonstrates the issue:
Am I doing something wrong? Is there some trick to making say $some_tied_handle ... act like say STDOUT ...? Or is this a bug? If it is a well known a bug, I didn't have much luck finding it using a general google search. Is there a better way to check to see if a bug is a known perl bug? Platform is Debian (Lenny) perl=5.10.0 Update: Replaced broken shortcut with explict http link, in light of toolic's reply below. In reply to Why won't say act like say when its tied? by ELISHEVA
|
|