CLASS(3)
π CLASS(3) π
okay bestie, welcome to the User Contributed Perl Documentation page for CLASS(3) β itβs giving tiny module, huge convenience. weβre gonna get you comfy with it, fr fr. π
β¨
β¨ NAME β¨
CLASS β Alias for __PACKAGE__
πΈ SYNOPSIS πΈ
package Foo;
use CLASS;
print CLASS; # Foo
print "My class is $CLASS\n"; # My class is Foo
sub bar { 23 }
print CLASS->bar; # 23
print $CLASS->bar; # 23
π DESCRIPTION π
okay so CLASS and $CLASS are both literally synonyms for __PACKAGE__. Theyβre just easier to type β thatβs the whole slay. π«Ά
$CLASS also has the extra benefit of working inside strings β iconic behavior, no cap. π
π§ NOTES π§
CLASSis a constant, not a subroutine call.$CLASSis a plain variable β it is not tied.- There is no performance loss for using
CLASSover__PACKAGE__except the loading of the module. (Thanks Juerd.) π
π AUTHOR π
- From February 2022 onward: Jacques Deguest
<jack@deguest.jp> - Michael G Schwern
<schwern@pobox.com>
π LICENSE π
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See <http://www.perl.com/perl/misc/Artistic.html>
π SEE ALSO π
kisses bestie π this page is from perl v5.42.0, dated 2023-09-24, and yeah itβs CLASS(3) β go be iconic with your package names π«Άβ¨
π¦ where this page comes from
- opensuse-leap 16.0: perl-CLASS 1.1.8-bp160.1.11 Β· Artistic-1.0 OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms