I guess you're looking for something called a Modulino, e.g.: http://www.drdobbs.com/scripts-as-modules/184416165
The basic idea is to make your script behave as a program when executing and to behave as a package while testing.
In reply to Re: Testing a .pl script
by Monk::Thomas
in thread Testing a .pl script
by perl_help26
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |