The name is short, since calling it "Acme::Autoflush" would pretty well defeat the purpose.
package AF;
# that's all there is to this module; we just
# want STDOUT to autoflush. If a different
# handle is selected when we get here, well,
# too bad =)
# As merlyn pointed out, I didn't need a BEGIN here...
$|=1;
# USAGE: perl -MAF -ne'whatever-you-want'
# or
# perl -MAF -pe'whatever'
# I don't even need this 1, since the result of the
# assignment is 1, but I think it's cleaner to leave this
# in
1;
My 1-liners tend to be a bit more complex than this would handle (in fact, they're often 2 and 1/2 liners:), but that'd be very handy for the short cases.
--
Mike