in reply to Print Problem: Progress Printout Prevented

For those without the benefit of being in the CB at the time, this problem has been resolved.

It's only that the constantly updating progress line at the bottom doesn't get printed, ever.

Turns out that wasn't true. All the updates were being printed at once at the end. <> blocks until a newline is received, but mencoder wasn't sending any between the updates. Switching to getc solved the problem. Switching to sysread should also work, but more efficiently.

#!/usr/bin/perl -w # zenconv.pl --- Converts Files for play on Creative Zen use warnings; use strict; die "Wrong Number of Args, stupid!\n" if (@ARGV != 2); open(my $conversion, '-|', mencoder => $ARGV[0], -oac => 'mp3lame', -aid => 128, -ovc => 'xvid', -xvidencopts => 'bitrate=-1', -vf => 'scale', -zoom, -xy => 320, -o => $ARGV[1], ); { local $| = 1; while ( sysread($conversion, my $buf, 4096) ) { print $buf; } }