in reply to what does '$| = 1' mean?
On a practical level for beginners, it means: Dont' buffer STDOUT. Normally when your program outputs data, it waits for 2k worth of data to accumulate, before printing. When you set $|=1; the program will output any data immediately, without buffering. This is very useful in cgi. For a little example of what this means in a real program:
#!/usr/bin/perl #without a newline, it won't print #until the buffer is 2k #$|=1; # try it with and without this line :-) while (1){ print 'aaaaaa'; select(undef,undef,undef,.03); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: what does '$| = 1' mean?
by virtualsue (Vicar) on Aug 11, 2002 at 17:55 UTC |