Game::Asset::PerlModule - A game asset that's a Perl module
Handles an asset that's a Perl module.
The code in the module is loaded up much like any other Perl module. As with any other Perl module, you should trust the source of the code being loaded.
For the most part, you would write the module code the same as any other module. There is only one small change: instead of having 1; as your last line to return a true value, you should have __PACKAGE__;. Game::Asset::PerlModule uses this to get the package name of the module.
1;
__PACKAGE__;
Game::Asset::PerlModule
While it is possible to load multiple packages into a single file, it's recommended to avoid this within Game::Asset::PerlModule.
Returns the name of the package that was loaded.
To install Game::Asset, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Game::Asset
CPAN shell
perl -MCPAN -e shell install Game::Asset
For more information on module installation, please visit the detailed CPAN module installation guide.