in reply to simple print question

I'm not sure what your question is, but I'll try to answer it. In perl you don't have to end every 'print' statement with a '\n'. If you want 'done' printed after 'I am doing something...' you do just that:
print "I am doing something..."; print "done";
This wil print "I am doing something...done". You have to add the '\n' if you want the rest of the text to start at the beginning of a line. For a nice effect while it's doing something you can add the dots while it's doing something:
print "I am doing something"; for (my $i=0; $i<10; $i++) { print "."; sleep 1; #or whatever your script is doing } print "done";

Replies are listed 'Best First'.
Re: Re: simple print question
by Lorand (Beadle) on Mar 26, 2004 at 16:14 UTC
    I knew that, but the problem was that Perl is buffering the output, as the other guys said. So I was getting what I wanted, but not when I wanted. To put it simple, the first part showed up only when the second part was printed too, and I didn't get the desired effect.

    But the $| = 1 trick solves the problem... thanks guys!