Tie::Scalar::MarginOfError

Scalars that have margins of error
Download

Tie::Scalar::MarginOfError Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Publisher Name:
  • Stray Taoist
  • Publisher web site:
  • http://search.cpan.org/~strytoast/

Tie::Scalar::MarginOfError Tags


Tie::Scalar::MarginOfError Description

Scalars that have margins of error Tie::Scalar::MarginOfError is a Perl module that allows you to have a scalar which has to stay within a certain margin of error. Your code will die (or execute what was passed in via the 'callback' subref) if the scalar's value goes outside this range.You tie a variable, and give it an initial value and a tolerance. Your code will die (or execute what was given in the callback subref) if the value gets beyond +/- whatever you have set the tolerance to be.In the SYNOPSIS example, $val will cause your code to execute &some_sub if it gets above 1.1 or below 0.9.If no callback is defined, then the code will simply croak.SYNOPSIS use Tie::Scalar::MarginOfError; tie my $val, 'Tie::Scalar::MarginOfError', { tolerance => 0.1, initial_value => 1, callback => \&some_sub, }; Requirements: · Perl


Tie::Scalar::MarginOfError Related Software