Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Cannot create distro with Module::Build

by GUIfriend (Sexton)
on Mar 28, 2013 at 11:13 UTC ( #1025939=perlquestion: print w/replies, xml ) Need Help??
GUIfriend has asked for the wisdom of the Perl Monks concerning the following question:

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\ build_distrib\Mydistro\lib\Mymoddir\ 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<>}, 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/ Mydistro/script/ Makefile.PL META.yml META.json

and that's what the tarball contains.

For a test installation, I unpack the tarball to

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


Replies are listed 'Best First'.
Re: Cannot create distro with Module::Build
by choroba (Bishop) on Mar 28, 2013 at 11:44 UTC
    I am not sure whether this is the cause of your problems, but
    module_name => "$distro/lib/Mymoddir/Mymod",
    seems wrong to me. The name should be something like Mymoddir::Mymod, see module_name at Module::Build::API.
    لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

      Thank you for your kind help. After correcting this, the path of the .packlist file has changed from ...\auto\Mydistro\lib\Mymoddir\Mymod\.packlist to ...\auto\Mymoddir\Mymod\.packlist. Unfortunately this is the only change in the result.

Re: Cannot create distro with Module::Build
by Anonymous Monk on Mar 29, 2013 at 00:07 UTC

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1025939]
Approved by Corion
[karlgoethebier]: Rollmops == German Sushi
[erix]: Haxen (sushi?)

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (7)
As of 2017-11-21 11:23 GMT
Find Nodes?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:

    Results (297 votes). Check out past polls.