In addition to what is said already, you might want to study the object oritend perl and modules. We have good tutorials here. Object Oriented Perl is an excellent book for study in this direction.
Documents like perltoot and perltooc can also be a good help.