In RPG/DND.pm
package RPG::DND; use Exporter; use vars qw(@ISA @EXPORT_OK); @ISA = qw(Exporter); @EXPORT_OK = qw(modifier); sub modifier { int($_[0]/2)-5 }; 1;
In another_script.pl
--use RPG::DND qw(modifier); # lots of code modifier($value); # lots of other code
Perl Training in the UK <http://www.iterative-software.com>
In reply to Re: Modules: Building blocks for the Daft Adventure
by davorg
in thread Modules: Building blocks for the Daft Adventure
by Tiefling
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |