To build a package, use Module::Install, ya turkey!
Make a directory for your package to reside:
Put your module in the 'lib' directory. This is where all your code is going to live.
Put your code in My/Package.pm, or copy the file you already wrote here.
Then, create a Makefile.PL in /home/you/My-Package:
# Define metadata
# Specific dependencies
test_requires 'Test::More' => '0.42';
Then, just run your new shiny file, pal!
perl Makefile.PL && make && make install && make clean && rm Makefile.old
While your at it, put that in a file called 'install.sh' so you can execute that each time you install it. You've gotta be root to run this sucker!
sudo sh install.sh
Afterwards, your directory will looks like this:
inc/ install.sh* lib/ Makefile.PL META.yml