On 3/29/06, Jan Dubois <jand@activestate.com> wrote: > On Wed, 29 Mar 2006, demerphq wrote: > > On 3/29/06, Yuval Kogman <nothingmuch@woobling.org> wrote: > > > On Wed, Mar 29, 2006 at 12:46:57 +0200, demerphq wrote: > > > > > > > overload::StrVal is a fairly slow procedure. Is there a reason why > > > > Tie::RefHash doesnt use Scalar::Util::refaddr() instead? Its much > > > > faster. > > > > > > It probably relates to it's availability, which is a non issue in > > > core perl, right? > > > > Sorry I missed this point.... > > > > Scalar::Util is in core since 5.8, and is available for 5.6. > > Yes, but refaddr() is new in the core Scalar::Util since 5.8.1, not 5.8. It'd be easy enough to fail over to overload::StrVal. I added just such a snippet to Data::Postponed this morning so I could use a fact function when possible but still work if it wasn't available. I checked Scalar::Util and it's Changes documents 1.09 as the first version with the refaddr function. BEGIN { eval "use Scalar::Util 1.09 qw( refaddr );"; if ( not defined &refaddr ) { *refaddr = \ &overload::StrVal; } }Thread Previous | Thread Next