A circular buffer is a specific implementation of a queue which has the following features:
All of these features are offered by a plain array based queue in Perl (see below), so I don't see the point of implementing a circular buffer in Perl unless its faster (but I doubt that).
my @q; while (@q) { my $item = shift(@q); # Insertion ... push @q, ...; # Removal ... }
In reply to Re: Circular buffer
by ikegami
in thread Circular buffer
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |