use v5.14; package Foobar { sub new { bless [] => shift; } sub quux { return "documentation" unless @_; say "The method has been called!"; } } my $obj = Foobar->new; $obj->quux; # calls the method print Foobar::quux(); # prints the documentation