1Class::Accessor::Fast(3U)ser Contributed Perl DocumentatiColnass::Accessor::Fast(3)
2
3
4
6 Class::Accessor::Fast - Faster, but less expandable, accessors
7
9 package Foo;
10 use base qw(Class::Accessor::Fast);
11
12 # The rest is the same as Class::Accessor but without set() and get().
13
15 This is a faster but less expandable version of Class::Accessor.
16 Class::Accessor's generated accessors require two method calls to
17 accomplish their task (one for the accessor, another for get() or
18 set()). Class::Accessor::Fast eliminates calling set()/get() and does
19 the access itself, resulting in a somewhat faster accessor.
20
21 The downside is that you can't easily alter the behavior of your
22 accessors, nor can your subclasses. Of course, should you need this
23 later, you can always swap out Class::Accessor::Fast for
24 Class::Accessor.
25
26 Read the documentation for Class::Accessor for more info.
27
29 "EFFICIENCY" in Class::Accessor for an efficiency comparison.
30
32 Copyright 2017 Marty Pauley <marty+perl@martian.org>
33
34 This program is free software; you can redistribute it and/or modify it
35 under the same terms as Perl itself. That means either (a) the GNU
36 General Public License or (b) the Artistic License.
37
38 ORIGINAL AUTHOR
39 Michael G Schwern <schwern@pobox.com>
40
42 Class::Accessor
43
44
45
46perl v5.38.0 2023-07-20 Class::Accessor::Fast(3)