#!/usr/bin/perl package testModule; use strict; use warnings; sub new{ my $class = shift; my $self = {}; bless $self, $class; return $self; } sub printSomething{ return 'Something!'; } 1; #### #!/usr/bin/perl -w use strict; use testModule; my $ob = new testModule; print $ob->printSomething;