in reply to A quicker way to have protected and private fields?

Read through the documentation for Class::Std. It has what you're looking for. Here's an example.
package SomeClass; use strict; use warnings; use Class::Std; { # Attributes my %whatever: ATTR; # this initializes the class in place of new sub BUILD { my ($self, $ident, $arg_ref) = @_; ... # Do some initialization stuff here } # here's a method that's private. It throws an exception when call +ed from outside the class it's declared. sub some_method: PRIVATE { my ($self) = @_; ... # Some class stuff here } }


BMaximus