Refine - Refine an instance with new methods
0.01
Refine is a module that export $_refine which can be used to add methods object instances. Each $_refine call on the object will create a new class with the new refined methods and rebless the instance into that class, which keeps the original class as it was.
$_refine
This is an EXPERIMENTAL release. The class generator might change in future releases.
use Refine; use Data::Dumper (); my $obj = Some::Class->new; # add the dump() method to the $obj instance $obj->$_refine( dump => sub { Data::Dumper->new([$_[0])->Terse(1)->SortKeys(1)->Dump }, );
Sub::Name
If you have Sub::Name installed, the methods will have proper names, instead of "__ANON__". This will make stacktraces easier to read.
Copyright (C) 2014, Jan Henning Thorsen
This program is free software, you can redistribute it and/or modify it under the terms of the Artistic License version 2.0.
Jan Henning Thorsen - jhthorsen@cpan.org
jhthorsen@cpan.org
To install Refine, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Refine
CPAN shell
perl -MCPAN -e shell install Refine
For more information on module installation, please visit the detailed CPAN module installation guide.