in reply to How to get explicity the autoflush var ($|) of a TIED HANDLER?

I don't have a real answer, but IO::Handle does something of the same sort in its autoflush() method, so it can be done: that's the definition of the sub on my 5.6.1 perl:
sub autoflush { my $old = new SelectSaver qualify($_[0], caller); my $prev = $|; $| = @_ > 1 ? $_[1] : 1; $prev; }
HTH,
Ant9000
  • Comment on Re: How to get explicity the autoflush var ($|) of a TIED HANDLER?
  • Download Code

Replies are listed 'Best First'.
Re: Re: How to get explicity the autoflush var ($|) of a TIED HANDLER?
by ysth (Canon) on Dec 30, 2003 at 02:20 UTC
    That's a different situation. Because autoflush is a method of the filehandle object, it has access to it (as $_[0]). With a tied filehandle, the methods are called using the tied object returned by TIEHANDLE, which doesn't have any way to access the original tie'd handle unless it was passed as an extra parameter to tie.