---
name: "CLASS"
section: "3pm"
platform: "linux"
package: "libclass-perl"
version: "1.1.8-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/CLASS"
---

# CLASS(3pm)

Alias for \_\_PACKAGE\_\_

## 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

CLASS and `$CLASS` are both synonyms for \_\_PACKAGE\_\_.  Easier to type.

`$CLASS` has the additional benefit of working in strings.

## NOTES

CLASS is a constant, not a subroutine call.  `$CLASS` is a plain variable, it is not tied.  There is no performance loss for using CLASS over \_\_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

[**perlmod**(1)](/perlmod/1.md)
