The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Tie::NumericRange - Perl extension that creates key / value pairs out of numeric ranges!

SYNOPSIS

  use Tie::NumericRange;
  my %h;
  tie (%h, Tie::NumericRange);
  
  $h{'2.90..9.65'} = "Some value for this fab range!";
  
  print $h{'3'} . "\n"; # prints "Some value for this fab range!\n"
  print $h{'4.621235'} . "\n"; # same
  print $h{'10.1235'} . "\n"; # prints undef . "\n"
  
  delete($h{'4'});
  print $h{'4'} . "\n"; # prints undef . "\n"
  print $h{'4.1'} . "\n"; # prints "Some value for this fab range!\n"
  
  keys(%h) #.. all the numbers in the ranges defined

DESCRIPTION

Tie::NumericRange creates a hash that takes numeric ranges as its keys. You can then reference the value assigned to the range using a member of that range.

SEE ALSO

Number::Range which does similar things, supports similar formats, but does not support floats and uses an object / method interface instead of a hash interface.

AUTHOR

Michael Gregorowicz, <mike@mg2.org>

COPYRIGHT AND LICENSE

Copyright (C) 2008 by Michael Gregorowicz

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.