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

I know that! (As my code show).

Actually a tied handle just doesn't buffer automatically, since it has an autoflush value ($|) like any other output!

My problem is not to make the buffer system, is the autoflush value, that exists in the tied handle and should be used if was implemented there!!!

In other words, I'm not talking, and haven't talked, about buffers!

Graciliano M. P.
"Creativity is the expression of the liberty".

  • Comment on Re: •Re: How to get explicity the autoflush var ($|) of a TIED HANDLER?

Replies are listed 'Best First'.
•Re: Re: •Re: How to get explicity the autoflush var ($|) of a TIED HANDLER?
by merlyn (Sage) on Dec 27, 2003 at 23:26 UTC
    OK, taking another tack at this: you want the glob to which you're tied. I don't think Perl provides that, either in each call, or even in the TIEHANDLE method. So, the user can set and clear $| all day on that handle, and you have no clue how to get to it. That's life.

    -- Randal L. Schwartz, Perl hacker
    Be sure to read my standard disclaimer if this is a reply.

      Seems like it would be reasonable to have tie methods triggered by getting or setting $|. Ditto $., etc. Someone would have to come up with a coherent naming scheme, though.

      In the meantime, you can pass a reference to the glob to TIEHANDLE and stash it away somewhere.

      I can get the $|, since is the value of the select output, tied or not. What I can't ensure is that $| value is from my TIEDHANDLE, or not, since I can't ensure that when PRINT() is called my TIEDHANDLE is selected or not. In 90% of the cases it's select, but I can't open doors for bugs.

      Graciliano M. P.
      "Creativity is the expression of the liberty".

        Actually, I'd say more like 9% not 90%. I think the number of times I use select for a handle and then use it as the default for print can be counted on one hand in the past three yeras of coding. Whereas the number of times I've written print HANDLE $somethign is close to at least once per program.

        But that's why I said you can't get to it. You don't know what to select, so you can't see it.

        -- Randal L. Schwartz, Perl hacker
        Be sure to read my standard disclaimer if this is a reply.