Th. J. van Hoesel th.j.v.hoesel at
Wed May 1 16:06:35 BST 2013


As agreed upon with Dave Cross, I would make some really cool changes to his module Number::Fraction - I as former math teacher love fraction.

However, can someone point me out what is happening between lines 132 and 144 of ? This part is the neatest part of the module, where it enables the module to use constants in your Perl programs.


my %_const_handlers =
  (q => sub { return __PACKAGE__->new($_[0]) || $_[1] });

=head2 import

Called when module is C<use>d. Use to optionally install constant


sub import {
  overload::constant %_const_handlers if $_[1] and $_[1] eq ':constants';

More information about the mailing list