Alias for _\|_package_\|_
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
\s-1CLASS\s0 and $CLASS are both synonyms for _\|_PACKAGE_\|_. Easier to type.
$CLASS has the additional benefit of working in strings.
\s-1CLASS\s0 is a constant, not a subroutine call. $CLASS is a plain variable, it is not tied. There is no performance loss for using \s-1CLASS\s0 over _\|_PACKAGE_\|_ except the loading of the module. (Thanks Juerd)
Michael G Schwern <[email protected]>
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>
perlmod\|(1)