Array::IntSpan

Handles arrays of scalars or objects using IntSpan techniques
Download

Array::IntSpan Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Dominique Dumont
  • Publisher web site:
  • http://search.cpan.org/~ddumont/

Array::IntSpan Tags


Array::IntSpan Description

Handles arrays of scalars or objects using IntSpan techniques Array::IntSpan is a Perl module that brings the speed advantages of Set::IntSpan (written by Steven McDougall) to arrays. Uses include manipulating grades, routing tables, or any other situation where you have mutually exclusive ranges of integers that map to given values.The new version of Array::IntSpan is also able to consolidate the ranges by comparing the adjacent values of the range. If 2 adjacent values are identical, the 2 adjacent ranges are merged.SYNOPSIS use Array::IntSpan; my $foo = Array::IntSpan->new(, , ); print "A score of 84% results in a ".$foo->lookup(84).".\n"; unless (defined($foo->lookup(70))) { print "The grade for the score 70% is currently undefined.\n"; } $foo->set_range(70, 79, 'C'); print "A score of 75% now results in a ".$foo->lookup(75).".\n"; $foo->set_range(0, 59, undef); unless (defined($foo->lookup(40))) { print "The grade for the score 40% is now undefined.\n"; } $foo->set_range(87, 89, 'B+'); $foo->set_range(85, 100, 'A'); $foo->set_range(100, 1_000_000, 'A+'); Requirements: · Perl


Array::IntSpan Related Software