in reply to what is the meaning of $| in perl?

G'day Sriram,

i am unable to understand these two lines:
select(LOGFILE); $| = 1; select(STDOUT);

The documentation for select has an example which is almost identical to the code you posted. It also has an example of autoflush() that was mentioned earlier in this thread.

If you familiarise yourself with the documentation available from http://perldoc.perl.org/perl.html, you'll get answers a lot quicker than you will by posting a question here and then waiting for replies.

One thing, that perhaps is not immediately apparent from the perlvar documentation, is that $| only has two states:

$ perl -le 'print $|; $| = 999; print $|; $| = ""; print $|' 0 1 0

-- Ken