Sunday afternoon hack: calling object methods on ARRAY and HASH refs

Andy Wardley abw at wardley.org
Sun Jun 15 18:54:01 BST 2008


Andy Armstrong wrote:
> http://search.cpan.org/~chocolate/autobox/lib/autobox.pod

Nice.  Replacing the op default handler is undoubtedly the More Right
way to do it.

     # This turns on autoboxing i.e. the method call checker sets a flag on the
     # method call op
     # and replaces its default handler with the autobox implementation.
     #
     # It needs to be set unconditionally because it may have been unset in
     # unimport

     $^H |= 0x120000;  # set HINT_LOCALIZE_HH + an unused bit to work around a 
%^H bug

A





More information about the london.pm mailing list