use File::Basename; (my $pm_name = __PACKAGE__ . '.pm') =~ s[::][/]g; my $images_dir = File::Spec->catdir(dirname($INC{$pm_name}), 'Images');