Duh. I don't see that as a big problem, frankly.
My solution gets your module available from ActiveState as a PPM download (likely). Then for those who haven't learned the lesson of ETOOMUCHMAGIC and not only insist on using aliased.pm and overload.pm but using them together need only make sure they have a new enough Scalar::Util and everything works.
Yes, it'd be nice if you could encode into the automation tools "Require Scalar::Util, but if you use overload.pm on your aliased module, then require version X of it".
An improved version of my fix is:
package aliased; BEGIN { eval { require Scalar::Util }; if( defined &Scalar::Util::refaddr ) { *refaddr= \&Scalar::Util::refaddr; } else { eval { require overload }; if( defined &overload::Overloaded ) { *refaddr= sub { if( overload::Overloaded( $_[0] ) ) { require Carp; Carp::confess( "Upgrade Scalar::Util ..." ); } return 0+$_[0]; }; } else { *refaddr= sub { 0+$_[0] }; } } } ...
- tye
In reply to Re^3: Working Around Missing Modules (KISS)
by tye
in thread Working Around Missing Modules
by Ovid
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |