use IO::Handle; autoflush FH 1; # first way FH->autoflush(1); # OO-ish way