Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

What does this mean?
$| =1;
its a pipe doing what?

janitored by ybiC: Retitle from "Interpretation of syntax"

Replies are listed 'Best First'.
Re: What does this mean? $|=1;
by broquaint (Abbot) on Mar 01, 2004 at 17:57 UTC
    It's enabling autoflushing of the buffers for the currently selected filehandle. See. perlvar for more info.
    HTH

    _________
    broquaint

      Can I interpret that as meaning it automatically clears the buffer on the OS?
        Every write will result in immediate output, rather than getting queued up for speed/efficiency essentially. Read the link below. It's good.

        If you have experience with other programming languages, STDOUT is typically buffered, STDERR is not. Thus you sometime see strange ordering if mixing the two. Autoflush fixes that -- among other things.

Re: What does this mean? $|=1;
by Ovid (Cardinal) on Mar 01, 2004 at 18:25 UTC
Re: What does this mean? $|=1;
by flyingmoose (Priest) on Mar 01, 2004 at 19:22 UTC
    Aside: Consult your perl documentation on the "English" module if you would like to use more descriptive names in the future. I don't "use English", but sometimes it helps code to be read more easily by non-Perl programmers or folks that are new to Perl.

    The Camel book also has a huge list of "magic" variables in the back, which is well worth the read. There is probably a free list of this somewhere as well, I just prefer to read dead tree when I can.