2009/9/10 Erez Schatz <moonb...@gmail.com>:
> 2009/9/10 Philip Potter <philip.g.pot...@gmail.com>:
>> 2009/9/10 Tariq Doukkali <tariq.doukk...@autoform.de>:
>>> Hi,
>>>
>>> i can not understand, what does this code:
>>>
>>>
>>> $| = 1;
>
> This means the programmer wishes that the buffer will be flushed after
> every write, or print.
> Normally (i.e. $| = 0), the computer stores output in a buffer, which
> is processed, flushed, after its full. Since this might cause messages
> to not appear at due time ("suffering from buffering"), you may want,
> or need, to set the autoflush special variable ($|) to true (in Perl,
> you assign a true value, 1 in this case, to it).
>
>>
>> $| is a special variable. All perl special variables are listed in
>> perldoc perlvar. See that document for a full explanation.
>
> This isn't really helping, sorry.

I'll let the OP say whether he was helped by my answer or not.

I prefer not to give a direct answer on-list which I can easily get
from the docs. I don't mind if others prefer to give a direct answer
on-list. But to leave off the most important piece of knowledge the
beginner could take away from this -- how he could have looked it up
for himself -- is being most unhelpful. You have solved his problem
for today, but you have not helped him grow as a programmer. What if
tomorrow he needs to know what $; means? With my answer, he now knows
he can consult "perldoc perlvar" -- with yours, he is none the wiser
and must return here.

Philip

-- 
"I have always wished for my computer to be as easy to use as my
telephone; my wish has come true because I can no longer figure out
how to use my telephone."
  --Bjarne Stroustrup

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to