MySQL::Slurp::Writer - Adds buffering / locking writing to MySQL::Slurp
my $writer = MySQL::Slurp::Writer->new( ... ); $writer->print( "records\tto\tprint\n" );
This module wraps IO::File to provide a thread-safe method for writing to a file handles. The method is simple ... writing is buffered; the file handle is locked; the output is written to the file handle, the lock is released.
Create a new MySQL::Slurp::Writer object
The size of the buffer. The default is 1 record, i.e. no buffering.
The filename of the IO::File object
Write arguments to the buffer and if the buffer is full, commit to the file handle
Flush the buffer
Closes the writing file handle
Block until an exclusive lock can be made on the file handle
Release the lock
- item Generalize to object independent of MySQL::Slurp
MySQL::Slurp, IO::File, Moose
Christopher Brown, <ctbrown@cpan.org<gt>
http://www.opendatagroup.com
Copyright (C) 2008 by Open Data
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.
To install MySQL::Slurp, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MySQL::Slurp
CPAN shell
perl -MCPAN -e shell install MySQL::Slurp
For more information on module installation, please visit the detailed CPAN module installation guide.