in reply to Circular buffer

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 ... }