To do the conversion from module name to file path in a platform independent way, I suggest the
File::Spec module, which is part of the core distribution. This will create a path appropriate for whatever system the code happens to be running on:
use File::Spec;
my @module = split /::|-/, $module;
$module = File::Spec->catfile(@module);
(Note: much of the documentation for File::Spec is actually, and unfortunately, in the File::Spec::Unix module. I haven't found that documentation on this site, so you'll have to read it on your local system.)