in reply to Re: •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?

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.

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

Replies are listed 'Best First'.
Re: •Re: Re: •Re: How to get explicity the autoflush var ($|) of a TIED HANDLER?
by ysth (Canon) on Dec 28, 2003 at 07:32 UTC
    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.

Re: •Re: Re: •Re: How to get explicity the autoflush var ($|) of a TIED HANDLER?
by gmpassos (Priest) on Dec 29, 2003 at 07:48 UTC
    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.