in reply to flushing a filehandle in PurePerl

Use this:

sub flush { my $osh = select($_[0]); my $oaf = $|; $| = 1; $| = $oaf; select($osh); return 1; }

Update: Added last two bullets and the code snippet.