[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Is MacPerl 5.0.7r1m much slower than 4.1.8 or is itjust me?



Try the same thing but add a '| catenate' to the end of the mpw command:
        
        perl -e '<script>' | catenate

Perl4 was block buffering stdout by default.  Perl5 is now line buffering, and
all the scrolling is slowing down the output.  The catenate will buffer the
output till the end.

Optionally, you could reopen stdout from stderr, and make it unbuffered,
which I think will return stdout to block buffered:

        open(STDOUT, ">&STDERR") || warn "Can't dup STDOUT from STDERR: $!";
        select STDOUT;
        $| = 0;

        print "text\n" x 100;

Yep, just tried it, that works.  --ed