#!/usr/bin/perl use strict; use warnings; open (FILE, '>', 'foo.txt') or die "Unable to open foo.txt for writing : $!"; select FILE; $| = 1; # FILE is now unbuffered print "hello, world\n"; print STDOUT "goodbye cruel world\n"; # still buffered