Swalif has asked for the wisdom of the Perl Monks concerning the following question:

Greets monks, I can't seem to figure out File::ShareDir::Install. Here is what I did..
1-created my module and put all my assets (.po files) in share/ dir.
2- In the MakeFile
use ExtUtils::MakeMaker; use File::ShareDir::Install; install_share 'share'; install_share dist => 'share'; ##also tried this: install_share module => 'My::Module', 'share';
3- In the module file:
use File::ShareDir ':ALL'; File::ShareDir::dist_file('My-Distribution', 'file.po'); #and File::ShareDir::dist_file('My-Distribution', 'share/file.po'); #and later tried this File::ShareDir::module_file("My::Module","file.po");
all cases failed to locate the file.
4- Also I had some tests cases but it seems that the files will not be available before make install, so I skipped this for now.
thanks

Replies are listed 'Best First'.
Re: Problem File::ShareDir::Install
by Anonymous Monk on Mar 14, 2012 at 14:17 UTC

    Um, what documentation are you reading? Read the synopsis, you're missing the postamble

    patch -p1 -i Tshare.diff

    $ perl Makefile.PL INSTALL_BASE=frackus Writing Makefile for Tshare Writing MYMETA.yml and MYMETA.json $ dmake install dmake: Warning: -- Target [blibdirs] was made but the time stamp has +not been updated. dmake: Warning: -- Target [config] was made but the time stamp has no +t been updated. cp share\file.txt blib\lib\auto\share\dist\Tshare\file.txt cp lib/Tshare.pm blib\lib\Tshare.pm dmake: Warning: -- Target [dynamic] was made but the time stamp has n +ot been updated. dmake: Warning: -- Target [pure_all] was made but the time stamp has +not been updated. Appending installation info to frackus\lib\perl5\MSWin32-x86-multi-thr +ead/perllocal.pod $ perl -Ifrackus/lib/perl5 -MTshare -e 1 frackus\lib\perl5\auto\share\dist\Tshare file.txt
      Great many thanks, this solved the problem.