package MySVG ; use strict ; use warnings ; use Exporter ; use vars qw( @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS ) ; @ISA = qw( Exporter ); @EXPORT = ( ) ; @EXPORT_OK = qw( gen_y family_y ) ; %EXPORT_TAGS = ( SVGFunc => [qw( &gen_y &family_y )] ) ; sub gen_y { my $gen = shift; my $multiplier = $gen - 1; my $gen_y = 36 + ( 76 * $multiplier); return $gen_y; } sub family_y { my ($gen, $two_parents, $one_parent) = @_; my $multiplier = $gen - 1; my $modifier = $two_parents ? 0 : $one_parent ? 18 : 38; my $family_y = (-18 + (-76 * $multiplier)) + $modifier; return $family_y; } 1; __END__ use examples (which should always work in case MySVG is in the same location as your program): - use MySVG qw( :SVGFunc ) ; - use MySVG qw( gen_y ) ; Ways to make perl find the lib in case it is somewhere else: - Add location of MySVG to PATH environment variable - use the perl -Idirectory switch - In case only your current project uses it and the pm file is in say "lib\MySVG\" and you are working on a file in lib\somewhere-else\: use File::Basename qw( dirname ) ; use lib dirname( dirname __FILE__ ) . '/MySVG' ;