Next Tricks of the Wizards 32

Globjects

        package IO::Flushable;        
        sub new {
          my ($package, $mode, $filename) = @_;
          open my $fh, $mode, $filename or return; 
          bless $fh => $package;
        }
        my $fh = IO::flushable->new(">", "logfile") or die ...;
        print $fh "Blah blah blah\n";
        syswrite $fh, $logentry;
        close $fh;


Next Copyright © 2003 M. J. Dominus