CGI/Perl Guide
|
Learning Center
|
Forums
|
Advertise
|
Login
Site Search:
in
Perl Guide
PerlGuru Forums
Learning Ctr
MAIN
INDEX
SEARCH
POSTS
WHO'S
ONLINE
LOG
IN
Home
:
Perl Programming Help
:
Intermediate
:
print caching?
Print Thread
aaaone
New User
Jan 9, 2008, 10:51 AM
Post #1 of 3 (1438 views)
print caching?
Can't Post
Hi! Who can explain why in this simple code "2" is not printed? And why it is printed if I use < print "2\n"; > ?
Thanks! (xpsp2, activestate perl 5.8)
----------------------------------------
use threads;
print "one\n";
async {
while (true)
{
print "1\n";
sleep 1;
}
};
print "two\n";
async {
while (false)
{
print "2"; # if "2\n" then it prints!!!
sleep 2;
}
};
print "waiting...";
<STDIN>;
KevinR
Veteran
Jan 10, 2008, 1:07 PM
Post #2 of 3 (1430 views)
Re: [aaaone] print caching?
[
In reply to
]
Can't Post
\n signals the system to flush the buffer I suppose.
-------------------------------------------------
aaaone
New User
Jan 18, 2008, 12:19 PM
Post #3 of 3 (1419 views)
Re: [KevinR] print caching?
[
In reply to
]
Can't Post
yeah.. thanks, but now I coped with that, using $|
... but working with STDOUT is more simplier, than with sockets... on Win32
Announcements
PerlGuru Announcements
Perl Programming Help
Frequently Asked Questions
Beginner
Intermediate
Advanced
Regular Expressions
mod_perl
DBI
Win32 Programming Help
Fun With Perl
Perl Quizzes - Learn Perl the Fun Way
Perl Golf
Perl Poetry
Need a Custom or Prewritten Perl Program?
I need a program that...
I Need a Programmer for Freelance Work
Throw Down The Gauntlet
General Discussions
General Questions
Feedback
Tutorial/Article Suggestions for The Learning Cent
Internet Security
Other Programming Languages
Javascript
PHP
Search
this forum
this category
all forums
for
All words
Any words
Whole Phrase
(
options
)
Powered by
Gossamer Forum v.1.2.0
Web Applications
&
Managed Hosting
Powered by Gossamer Threads
Visit our
Mailing List Archives