in reply to Re: how do I write directly to a file
in thread how do I write directly to a file

The other way to turn off buffering is to set the $| variable to a true value. This effects the currently selected default output filehandle (generally STDOUT) but you can change it on other filehandles like this:

my $fh = select COLORS; $|++; select $fh;

or in slightly more scarey code, like this:

select((select(COLORS), $| = 1)[0]);

So you can see why the IO::Socket method is preferred :)

--
<http://www.dave.org.uk>

Perl Training in the UK <http://www.iterative-software.com>