On Dec 10, 2003, at 8:25 AM, usef wrote:

Thank you guys for quick answers,

What if I want to print a "..." and calculate the percentage and amount of
currently downloaded size during the download process? (wget style), should
I create another process to do that? or is there any other alternative? (I
will choose the later).

I believe you're looking for $|, the autoflush variable. If set to a non-zero value, it causes perl to flush output after every print call, even without a \n. Try watching both of these one-liners execute to see what I'm talking about:


perl -e 'foreach (1..3) { print time, " "; sleep 3; } print "\n";'

perl -e '$| = 1; foreach (1..3) { print time, " "; sleep 3; } print "\n";'

Hope that helps.

James


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to