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

A "tied" handle doesn't buffer. Every call to "print" calls your ->PRINT routine. If you choose to buffer in that code, that's your business, and under your control.

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

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

Replies are listed 'Best First'.
Re: •Re: How to get explicity the autoflush var ($|) of a TIED HANDLER?
by gmpassos (Priest) on Dec 27, 2003 at 22:02 UTC
    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".

      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".