Re: printing "progress" marks problem...



Thanks John, You are on the right track and thanks for the quick
response. I googled for an answer for a while trying to figure out the
"best" way to word my search then finally found the answer... which is
basically yours :)

$| = 1;

Fix the issue!
Thanks again.

John wrote:
Hi

Sounds like the buffer is waiting. You can force buffer output.

our $old_fh=select(STDOUT);
$|=1; # Make PROGRESS socket hot
select($old_fh);

I know it works on Linux but I have no experience on Windows.

Regards
John

<tewilk@xxxxxxxxx> wrote in message
news:1160893107.425868.322940@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I have a simple program which I'm move about 10,000 files to different
folders on my hard drive. During the process I'm wanting to print
"progress" marks... nothing fancy but printing a character (*) for each
file moved. Progress mark works fine for small file counts but not for
the large file counts.

my print line is: print "*";

which at the end of my foreach loop...

looks like that perl is writing to stdout until my move is complete.
For example during my test of 15 files, the output prints out almost
instant because there is not much going on. But my test of 755 files
sits without printing a thing until all the files are moved. I know
the process is working (move process) because I see the file move out
of the working directory, then once it complete I have a half page of
"*".

Platform is windows xp. perl 5.8.8

any ideas?

Thanks


.



Relevant Pages

  • printing "progress" marks problem...
    ... "progress" marks... ... looks like that perl is writing to stdout until my move is complete. ... of the working directory, then once it complete I have a half page of ...
    (perl.beginners)
  • Re: printing "progress" marks problem...
    ... You can force buffer output. ... "progress" marks... ... looks like that perl is writing to stdout until my move is complete. ... of the working directory, then once it complete I have a half page of ...
    (perl.beginners)
  • Re: Perl style examples (summary)
    ... For CGI: http://users.easystreet.com/ovid/cgi_course/ (John W. Krahn) ... "Perl Best Practices" by Damian Conway ... Janet Goldstein, Christian Winter, Adrian Howard. ...
    (comp.lang.perl.moderated)
  • Re: regular expression
    ... Thanks John. ... > I am looking for help on a PERL regular expression that can do the ... Make sure that the string is 20 chars or else match should fail. ... If you are not the intended recipient, ...
    (perl.beginners)
  • Re: how to pass array and varaible
    ... John and Gunnar, ... > Any arguments passed in show up in the array @_. ... > of Perl created the element whether or not the element was assigned to.) ... > Assigning to the whole array @_ removes that aliasing, ...
    (perl.beginners)