http://www.perlmonks.org?node_id=244173


in reply to Possible to have a module act as a standalone??

Separate your data from its presentation. Put the code that does the actual program logic in a module, and then call it from either a standalone script or a CLI script. Make it simply return data and not print anything. Then the standalone script and CLI script get to decide how they want to display the data that is being returned.