I work with Windows XP and Strawberry Perl Portable Edition version 5.14.2. This is my 1st attempt to learn how to use Module::Build. I use a start script and a module. Their code looks as follows:

use strict; use warnings; use feature 'say'; use Mymoddir::Mymod; our $VERSION = v0.0.1; say 'start mymain'; my $answ = Mymoddir::Mymod::mysub('hello'); say "mysub returned: $answ";

-----

use strict; use warnings; use feature 'say'; package Mymoddir::Mymod; our $VERSION = v0.0.1; sub mysub { say 'mysub got: ', shift; return 'thanks'; }

The file structure for "perl Build.PL" is

build_distrib\Mydistro\script\mymain.pl build_distrib\Mydistro\lib\Mymoddir\Mymod.pm build_distrib\Build.PL

Build.PL reads

use 5.006; use strict; use warnings; use Module::Build; my $distro = 'Mydistro'; # Name of Distribution my $builder = Module::Build->new( dist_name => "$distro", dist_version => '0.000_001', module_name => "$distro/lib/Mymoddir/Mymod", license => 'perl', dist_author => q{GUIfriend<KWittrock@cpan.org>}, dist_abstract => 'Greetings', build_requires => { 'Test::More' => 0, }, requires => { 'perl' => 5.006, }, add_to_cleanup => [ "$distro-*" ], create_makefile_pl => 'traditional', );

I took the template of Build.PL from an earlier attempt to use Module::Starter::Smart (for a more complex program). Without the "module_name" parameter I get a warning

No 'module_name' was provided and it could not be inferred from other properties. This will prevent a packlist from being written for this file. Please set either 'module_name' or 'dist_version_from' in Build.PL.

After "Build dist" MANIFEST contains

Build.PL MANIFEST This list of files Mydistro/lib/Mymoddir/Mymod.pm Mydistro/script/mymain.pl Makefile.PL META.yml META.json

and that's what the tarball contains.

For a test installation, I unpack the tarball to
%tmp%\sudo\inst_mat

and then use the commands

cd /d %tmp%\sudo\inst_mat\Mydistro-0.000_001 perl Build.PL --destdir ..\..\sudodir verbose=1 Build Build install

There is only one file in the installation

%tmp%\sudo\sudodir\strawberry5.14\perl\site\lib\auto\Mydistro\lib\Mymo +ddir\Mymod\.packlist

... and it is empty. I don't get an error message.

I do hope that someone can tell me what I'm doing wrong.

Kind regards

GUIfriend


In reply to Cannot create distro with Module::Build by GUIfriend

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.