Module::Install can"t locate required modules

Module::Install can"t locate required modules

am 16.09.2007 23:20:24 von Matteo Corti

Hi,

I just tried to write my first Makefile.PL as follows:

# Load the Module::Install bundled in ./inc/
use inc::Module::Install;

# Define metadata (we read it from the script)
name 'dprofpp_grapher';
abstract_from 'dprofpp_grapher';
author_from 'dprofpp_grapher';
version_from 'dprofpp_grapher';
license_from 'dprofpp_grapher';

# Specific dependencies
require 'Data::Dumper' => 0;
# other requirements stripped

install_script 'dprofpp_grapher';

auto_install;

WriteAll;

All the required modules are available: I can run

perl -e "use Data::Dumper;"

for all the required modules without any problem.

When I run

perl Makefile.PL

I get

include /Users/corti/svn/nethz/tools/dprofpp_grapher/inc/Module/
Install.pm
include inc/Module/Install/Metadata.pm
include inc/Module/Install/Base.pm
Can't locate Data::Dumper in @INC (@INC contains: inc /sw/lib/
perl5/5.8.6/darwin-thread-multi-2level
/sw/lib/perl5/5.8.6 /sw/lib/perl5 /sw/lib/perl5/darwin
/System/Library/Perl//5.8.6/darwin-thread-multi-2level /System/
Library/Perl//5.8.6
/System/Library/Perl/ /System/Library/Perl/5.8.6//darwin-thread-
multi-2level
/System/Library/Perl/5.8.6/ /System/Library/Perl/5.8.6/darwin-thread-
multi-2level/
/System/Library/Perl/5.8.6/darwin-thread-multi-2level /System/
Library/Perl/5.8.6
/Library/Perl/5.8.6/darwin-thread-multi-2level /Library/Perl/5.8.6 /
Library/Perl
/Network/Library/Perl/5.8.6/darwin-thread-multi-2level /Network/
Library/Perl/5.8.6 /Network/Library/Perl
/System/Library/Perl/Extras/5.8.6/darwin-thread-multi-2level /System/
Library/Perl/Extras/5.8.6
/Library/Perl/5.8.1/darwin-thread-multi-2level /Library/Perl/
5.8.1 .) at Makefile.PL line 16.

How can I make Modules::Install find the same modules as the perl
executable?

Many thanks for any hint.

Matteo

Re: Module::Install can"t locate required modules

am 17.09.2007 09:09:45 von Matteo Corti

Hi again,

On Sep 16, 11:20 pm, Teo wrote:
> Hi,
>
> I just tried to write my first Makefile.PL as follows:
>
> # Load the Module::Install bundled in ./inc/
> use inc::Module::Install;
>
> # Define metadata (we read it from the script)
> name 'dprofpp_grapher';
> abstract_from 'dprofpp_grapher';
> author_from 'dprofpp_grapher';
> version_from 'dprofpp_grapher';
> license_from 'dprofpp_grapher';
>
> # Specific dependencies
> require 'Data::Dumper' => 0;
> # other requirements stripped
>

Sometimes a night of sleep and a couple of coffees can help: reading
the perlfunc man page about require and removing the quotes works like
a charm ...

Matteo

Re: Module::Install can"t locate required modules

am 17.09.2007 12:51:29 von Ben Morrow

Quoth Teo :
>
> I just tried to write my first Makefile.PL as follows:
>
> # Load the Module::Install bundled in ./inc/
> use inc::Module::Install;
>
> # Define metadata (we read it from the script)
> name 'dprofpp_grapher';

If your script does anything significant (which I assume it does), it
may well be better to extract the functionality out into a module (say,
App::DProfPPGrapher, or perhaps Devel::DProf::Graph) and have a
relatively trivial script that just calls into the module.

> abstract_from 'dprofpp_grapher';
> author_from 'dprofpp_grapher';
> version_from 'dprofpp_grapher';
> license_from 'dprofpp_grapher';

This can be simplified to

all_from 'dprofpp_grapher';

which will also attempt to extract a minimum Perl version from any

use 5.006;

or such you have.

>
> # Specific dependencies
> require 'Data::Dumper' => 0;

'require' is not a M::I command, it is a Perl command. I suspect you
meant 'requires'.

Ben

Re: Module::Install can"t locate required modules

am 17.09.2007 16:20:29 von Matteo Corti

Dear Ben,

On Sep 17, 12:51 pm, Ben Morrow wrote:
> Quoth Teo :
> > I just tried to write my first Makefile.PL as follows:
>
> > # Load the Module::Install bundled in ./inc/
> > use inc::Module::Install;
>
> > # Define metadata (we read it from the script)
> > name 'dprofpp_grapher';
>
> If your script does anything significant (which I assume it does), it
> may well be better to extract the functionality out into a module (say,
> App::DProfPPGrapher, or perhaps Devel::DProf::Graph) and have a
> relatively trivial script that just calls into the module.
>
> > abstract_from 'dprofpp_grapher';
> > author_from 'dprofpp_grapher';
> > version_from 'dprofpp_grapher';
> > license_from 'dprofpp_grapher';
>
> This can be simplified to
>
> all_from 'dprofpp_grapher';
>
> which will also attempt to extract a minimum Perl version from any
>
> use 5.006;
>
> or such you have.

Thanks

> > # Specific dependencies
> > require 'Data::Dumper' => 0;
>
> 'require' is not a M::I command, it is a Perl command. I suspect you
> meant 'requires'.

I just figured it out (a couple of cups of coffee can be of great
help :-)

Many thanks,

Matteo