I would guess it's a bug, because the program behaves more in line with your (and my) expectations on Perl 5.12:
use Symbol; use 5.012; { package Foo; sub TIEHANDLE { my ($sClass, $fh) = @_; return bless([$fh], $sClass); } sub PRINT { my $self = shift; my $fh = $self->[0]; CORE::print $fh "tied to $self:", @_; } } my $x=gensym; tie *$x, 'Foo', \*STDOUT; local $\="\n***\n"; say "Not tied: I'm just saying ..."; say $x "I'm just saying ..."; # outputs (note that say $x is followed by "\n***\n" # not "\n" # # Not tied: I'm just saying ... # tied to Foo=ARRAY(0x8197ed0):I'm just saying ... # ***
This is on Strawberry Perl 5.12:
This is perl 5, version 12, subversion 1 (v5.12.1) built for MSWin32-x +86-multi-thread
In reply to Re: Why won't say act like say when its tied?
by Corion
in thread Why won't say act like say when its tied?
by ELISHEVA
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |