my $xx = XX->new(); $xx->oopfunc("abc"); XX::staticfunc("abc"); {# the OOP module XX package XX; sub new { my $class = shift; my $params = $_[1]; my $parent = ( caller(1) )[3] || "N/A"; my $whoami = ( caller(0) )[3]; my $self = { 'state' => 'xxx' }; bless $self, $class; return $self } # call it as # my $xx = XX->new(); # $xx->oopfunc(...); sub oopfunc { my $self = shift; my $params = shift; print "i am using state: ".$self->{state}."\n"; } # call it as XX::staticfunc(...); sub staticfunc { my $params = shift; print "static func called.\n"; } 1 }