Author image Michael Shipper
and 1 contributors


Data::Range::Compare::Stream::Cookbook::ConsolidateAdjacent - HowTo Consolidate Dupplicate, Overlapping, and Adjacent ranges


This shows how to use the additional consolidation class.

Special notes

Adjacent ranges only exist when data has an exact begin and end pont. Examples that do not work include: Floating points, Analog ranges

The example in this pod relates to data with exact start and end boundries.

Example code

  use strict;
  use warnings;
  use Data::Dumper;
  use lib qw(../lib);
  use Data::Range::Compare::Stream;
  use Data::Range::Compare::Stream::Iterator::Array;
  use Data::Range::Compare::Stream::Iterator::Consolidate::AdjacentAsc;
  my $iterator=new Data::Range::Compare::Stream::Iterator::Array;
  my $consolidator=Data::Range::Compare::Stream::Iterator::Consolidate::AdjacentAsc->new($iterator);
  while($consolidator->has_next) {
    my $result=$consolidator->get_next;
    print $result,"\n";


Michael Shipper

Source-Forge Project

As of version 0.001 the Project has been moved to

Data Range Compare


Copyright 2011 Michael Shipper. All rights reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.