Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Comment on


Class::XSAccessor is freakishly fast. Given that a sub call still has to happen, you wouldn't expect it to eliminate that much overhead.

It does do one slightly scary thing though...

#! perl -slw use strict; use Data::Dumper; sub get_pp { $_[0]->{X}; } use Class::XSAccessor getters => { get_xs => 'X' }; { my $o = bless { X=>1 }, 'main'; my $ref = \($o->get_pp); $$ref++; print Dumper($o); } { my $o = bless { X=>1 }, 'main'; my $ref = \($o->get_xs); $$ref++; print Dumper($o); }

This came up in a recent Moose-related thread.

PS: there is Class::XSAccessor::Array as part of the same distribution.


In reply to Re^17: The Most Essential Perl Development Tools Today (negative) by tobyink
in thread The Most Essential Perl Development Tools Today by Tommy

and:  <code> code here </code>

  • Please read these before you post! —
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others perusing the Monastery: (5)
    As of 2014-12-27 19:22 GMT
    Find Nodes?
      Voting Booth?

      Is guessing a good strategy for surviving in the IT business?

      Results (177 votes), past polls