use Want;
if(want("OBJECT")){
return $self;
}
else{
return $value;
}
If you're planning on supporting method chaining, you'd best be using this module. Two warnings though: it causes the debugger to crash and it doesn't get along with the overload module.
-w and v-strings (Score:2, Insightful)
"require v5.6" should be "require 5.006" to make it -w safe.
And I think the module is too large. Perlhaps some autoloading technique can be used.
2;0 juerd@ouranos:~$ perl -le'print +(split " ", `cat
3026944
2;0 juerd@ouranos:~$ perl -le'use Want; print +(split " ", `cat
3469312