Class:...:Named(3pm)

πŸ“¦
version 0.009 Β· 2 versions
  • 0.009 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 0.009 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– Class::...:Named β€” wait, bestie, it's Class::Accessor::Named πŸ’–

okay so real talk, this page lives in the User Contributed Perl Documentation section of the manual (that's the (3pm) vibe, iykyk), and it's literally titled Better profiling output for Class::Accessor. Iconic of it. Let's get into it 🫢


✨ NAME ✨

Class::Accessor::Named β€” Better profiling output for Class::Accessor

like. that's the whole name. no notes. πŸ’…


🌸 SYNOPSIS 🌸

perl -MClass::Accessor::Named your_script.pl

that's it. that's the whole thing. one flag, one module, no cap. ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

so Class::Accessor is genuinely a slay way to automate the tedious little task of generating accessors and mutators. it's giving "let the computer do the boring part." but β€” and this is the one small drawback β€” because of the details of the implementation, you only get one __ANON__ entry in your profiling output. one. single. entry.

and that entry contains all your accessors. all of them. which can be a real pain if you're attempting to figure out which of your accessors is being called six billion times. six. billion. 😭

so this module is a development aid. it uses Hook::LexWrap and Sub::Name to talk your accessors into identifying themselves. like, "bestie, introduce yourself. tell the profiler your name." πŸ’…

it shouldn't add much additional runtime overhead, because it acts only on Class::Accessor's generator functions β€” but it has not been designed for production deployment. so no, do not ship this to prod. nope. πŸ™ˆ

πŸŽ€ DEPENDENCIES πŸŽ€

this module depends on, in order:

  • Class::Accessor
  • UNIVERSAL::require
  • Hook::LexWrap
  • Sub::Name

four little besties. all required. 🫢


🌈 INCOMPATIBILITIES 🌈

None reported. ✨ clean page, we love to see it.


πŸ’€ BUGS AND LIMITATIONS πŸ’€

this module uses Hook::Lexwrap to alter the behaviour of Class::Accessor and Class::Accessor::Fast. (yes, Class::Accessor::Fast too β€” we did not forget her. πŸ’œ)

due to the nature of Hook::LexWrap, this will skew your profiling a tiny bit. we could probably do a little more internals diving and eliminate the dependency and the deficiency. patches welcome. πŸ‘‘

please report any bugs or feature requests to bug-class-accessor-named@rt.cpan.org, or through the web interface at <http://rt.cpan.org>.


πŸ‘‘ AUTHOR πŸ‘‘

Jesse Vincent "<jesse@bestpractical.com>"


Copyright (c) 2006, Best Practical Solutions, LLC. All rights reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.


🚨 DISCLAIMER OF WARRANTY 🚨

okay bestie, deep breath, this part is in all caps because it's legally required to yell at you. here it is, word for word:

BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.

IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.


and that's the whole page, bestie. this beauty is running on perl v5.36.0, dated 2022-12-12 β€” go forth, profile responsibly, and remember: development aid only, not production. mwah. πŸ’‹βœ¨πŸŽ€

πŸ“¦ where this page comes from