Just think me as a kid. When i run the below script, it really print 1(not as your comment).
Well, that is not my code ;) buffering means printing doesn't happen immediately, it is delayed, barring a crash of some sort, it will happen eventually, like when a program exits, when all buffers are flushed .
Try this instead
use IO::Handle; print "\n2\n"; # \n forces a flush, 2 printed immediately print 1; # doesn't print, puts 1 in the buffer sleep 1; # still nothing printed STDOUT->autoflush(1); # buffered 1 printed print "\n"; # prints immediately sleep 1; print 1; # prints 1 immediately sleep 1; print "\n";
Without sleep, you wouldn't notice the buffering, and without sleep, I forget to add sleep or test my original code:) but its ok since I linked to the tutorial for you to read, and run its code, and believe what it says is true :) because it is :) I did, I did taw a puddy tat
In reply to Re^5: ztk-webcam snapshot-grabber
by Anonymous Monk
in thread ztk-webcam snapshot-grabber
by zentara
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |