IO::Buffered::Regexp - Regular expression buffering
The IO::Buffered::Regexp buffer type takes a regular expression as input and splits records based on that. Only the match defined in the () is returned and not the complete match.
IO::Buffered::Regexp
The options MaxSize and Double are optional.
MaxSize
Double
MaxSize provides a limit on how big a buffer can grow, when the limit is hit an exception is thrown.
Double defines the how the regexp is used to extract new items and remove old data from the buffer. By default a while loop is used that grabs and removes one item at a time from the buffer. If Double is defined another method is used:
my @records = ($self->{buffer} =~ /$regexp/g); $self->{buffer} =~ s/$regexp//g;
This might be faster in some cases and slower in others.
ReturnsLast sets what the returns_last() returns, this is used by the "Split" buffer type to return the correct value as it is just a wrapper.
ReturnsLast
returns_last()
Troels Liebe Bentsen <tlb@rapanden.dk>
Copyright(C) 2008 Troels Liebe Bentsen
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install IO::Buffered, copy and paste the appropriate command in to your terminal.
cpanm
cpanm IO::Buffered
CPAN shell
perl -MCPAN -e shell install IO::Buffered
For more information on module installation, please visit the detailed CPAN module installation guide.