Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Diagnostics and printing

by halxd2 (Monk)
on Sep 03, 2002 at 15:20 UTC ( [id://194790]=perlquestion: print w/replies, xml ) Need Help??

halxd2 has asked for the wisdom of the Perl Monks concerning the following question:

I'v been writting scripts that give the user a count-down until an event is about to start. It worked great:
while($time > 0) { print " " . ' ' x (3 - length($time)) . "$time $text"; foreach (1..$backcount){print "\b"} $time -= 1; sleep 1; }
As I began to put the script up to public use, I removed use diagnositics; Then my code no longer printed. I have it nailed down to
diagnostics. Any one seen this before?


Carpenter's dilemma "Too soon old, too late smart"

Replies are listed 'Best First'.
Re: Diagnostics and printing
by waswas-fng (Curate) on Sep 03, 2002 at 15:35 UTC
    If you are not seeing output as you expect try a $| = 1; in the upper part of your script to turn off buffering. with buffering on sometimes you don't get output to the screen until a /n is printed or the buffer fills.

    -Waswas
      Thank you. This really should have been a RTFM. But I really
      am greatful for the pointer. I never looked into file
      printing until you pointed the way



      Carpenter's dilemma "Too soon old, too late smart"

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://194790]
Approved by Snuggle
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2024-04-24 08:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found