| 1 | package Class::Fields::Attribs; | ||
| 2 | |||
| 3 | 7 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | |||
| 5 | 7 | ▶ | use vars qw( @EXPORT @ISA $VERSION ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 7 | @EXPORT = qw(PUBLIC PRIVATE INHERITED PROTECTED); | |
| 7 | 7 | require Exporter; | |
| 8 | 7 | @ISA = qw(Exporter); | |
| 9 | 7 | $VERSION = '0.03'; | |
| 10 | |||
| 11 | # Inheritance constants. | ||
| 12 | # Its too bad I can't use 0bXXX since its 5.6 only. | ||
| 13 | 7 | ▶ | use constant PUBLIC => 2**0; # Open to the public, will be inherited. |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 14 | 7 | ▶ | use constant PRIVATE => 2**1; # Not to be used by anyone but that class, |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 15 | # will not be inherited | ||
| 16 | 7 | ▶ | use constant INHERITED => 2**2; # This member was inherited |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 17 | 7 | ▶ | use constant PROTECTED => 2**3; # Not to be used by anyone but that class |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 18 | # and its subclasses, will be inherited. | ||
| 19 | |||
| 20 | # For backwards compatibility. | ||
| 21 | # constant.pm doesn't like leading underscores. Damn. | ||
| 22 | sub _PUBLIC () { PUBLIC } | ||
| 23 | sub _PRIVATE () { PRIVATE } | ||
| 24 | sub _INHERITED () { INHERITED } | ||
| 25 | sub _PROTECTED () { PROTECTED } | ||
| 26 | |||
| 27 | 7 | return 'FIRE!'; | |
| 28 | |||
| 29 | __END__ | ||