| Catmandu::Buffer(3pm) | User Contributed Perl Documentation | Catmandu::Buffer(3pm) |
Catmandu::Buffer - A base class for modules that need an array buffer
package MyPackage;
use Moo;
with 'Catmandu::Buffer';
# Print only when the buffer is full...
sub print {
my ($self,$str) = @_;
if ($self->buffer_is_full) {
print join "\n" , @{ $self->buffer };
$self->clear_buffer;
}
$self->buffer_add($str);
}
package main;
my $x = MyPackage->new;
for (my $i = 0 ; $i < 1000 ; $i++) {
$x->print($x);
}
A ARRAY reference to the content of the buffer.
The maximum size of a buffer.
Empty the buffer.
Returns a true value when there is content in the buffer.
Returns a true value when the buffer has reached its maximum capacity.
Adds $x to the buffer.
Catmandu::Solr::Bag
| 2023-03-03 | perl v5.36.0 |