sub new {
my ($class, $args) = @_;
+ if ($args->{filters}) {
+ die "Single filter please (XXX FIXME)"
+ unless @{$args->{filters}} == 1;
+ $args->{filter} = $args->{filters}[0];
+ }
bless(
{
_stream => $args->{stream},
);
}
-sub next {
+sub _next {
my ($self) = @_;
- # peeked entry so return that
-
- if (exists $self->{_peeked}) {
- return (delete $self->{_peeked});
- }
-
# if our main stream is already gone then we can short-circuit
# straight out - there's no way for an alternate stream to be there