Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: Modules: Building blocks for the Daft Adventureby modred (Pilgrim) |
on Jun 12, 2001 at 15:39 UTC ( [id://87773]=note: print w/replies, xml ) | Need Help?? |
Well, it all depends on how you setup your module.
If it is just a basic package that is not an object and does not \
use Exporter then you would call it like
If you use the Exporter module when creating your module, then you can (optionally) import the function name into the current namespace and just call it is as
If you make RPG::DND an object, you would create an object of that type, something like my $rpg = new RPG::DND;, and then you would call it like
Also, you might want to name it something like getModifer rather than just modifier so it is slightly clearer on what the subroutine does.
In Section
Seekers of Perl Wisdom
|
|