Creating your own subroutine file for use with subsequent scripts

If you have created one or more subroutines that you would like to be able to call from other scripts and don't want to have to explicitly define them in each script you can add such subroutines to a .pm file and store that file in a specific location.
You would then add the following lines to each script you wish to call the subroutine in:

use lib "c:/My Folder";
use myCommands;

Of course, myCommands.pm must be located in "c:/My Folder" and must be a valid Perl package.
You can refer to standard Perl documentation on how to create a Perl package, but here is a template (the "1;" at the bottom is important...):

# Template package
package myCommands;

use Exporter;

our \$VERSION = 2.1;
our @ISA = qw(Exporter);

our @EXPORT_OK = qw(
test
);

our %EXPORT_TAGS = ( all => [@EXPORT_OK]);
our @EXPORT = @EXPORT_OK;

sub test
{
print "Hello, World!\n";
}
1;