our $MyBin; BEGIN { my $file = __FILE__; # get the path to the directory of this file using File::Basename my $package = __PACKAGE__; $package =~ s/::/\//g; # chop off the package name from the end of the file path $file =~ s/$package\.pm//; $MyBin = $file . 'bin'; }