se strict; use warnings; use Test::More; use List::Util 'pairfirst'; my @data = ( { id => 1, start => 2, end => 3 }, { id => 2, start => 3, end => 4 }, { id => 3, start => 4, end => 5 }, # fail { id => 42, start => 6, end => 7 }, { id => 666, start => 7, end => 8 }, { id => 999, start => 8, end => 9 }, ); my @failed = pairfirst { $a->{'end'} ne $b->{'start'} } @data; is( @failed, undef, 'sequencing' ) or diag sprintf 'ID %s and ID %s are not sequential', map { $_->{'id'} } @failed; done_testing; __END__