in reply to Modules: Building blocks for the Daft Adventure
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
<http://www.dave.org.uk>
Perl Training in the UK <http://www.iterative-software.com>
In Section
Seekers of Perl Wisdom