in reply to class static member
package MyClass; our $total_objects; our $public_static_class_data; my $private_static_class_data; # For example: sub new { # ... $total_objects++; # ... }
In Perl 6, the above would work if you replace package with class (though in general you don't write a new method yourself in Perl 6).
|
|---|