File: README

package info (click to toggle)
libclass-perl 1.1.8-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 96 kB
  • sloc: perl: 97; makefile: 2
file content (39 lines) | stat: -rw-r--r-- 959 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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)