subclassing Action_install
[email protected] (Boyd Duffee) Thu, 11 Oct 2012 17:49:55 +0100
| Newsgroups | perl.module.build |
|---|---|
| Message-ID | <[email protected]> |
--------------030501060500020508080001
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Hi again,
Trying to learn more about custom install. I ran across the Modifying an
Action section in Module::Build::Cookbook and tried to shoehorn that bit of
code into my script. When I run
perl Build.PL
I get
Can't use string as a HASH ref while "strict refs" in use
when I call the create_build_script() method. I've attached the Build.PL
file. What am I doing wrong?
many thanks,
Boyd
I'm using M::B v0.4 / Fedora 13 / perl v5.10.1 x86_64-linux-thread-multi
This is me stepping through the build process with the debugger
Module::Build::Base::write_config(/usr/share/perl5/Module/Build/Base.pm:1318):
1318: File::Path::mkpath($self->{properties}{config_dir});
DB<1>
Can't use string ("Module::Build::Custom") as a HASH ref while "strict refs"
in use at /usr/share/perl5/Module/Build/Base.pm line 1318.
at /usr/share/perl5/Module/Build/Base.pm line 1318
Module::Build::Base::write_config('Module::Build::Custom') called at
/usr/share/perl5/Module/Build/Base.pm line 1956
Module::Build::Base::create_build_script('Module::Build::Custom') called at
Build.PL line 56
Module::Build::Base::CODE(0x17d23d0)(/usr/share/perl5/Module/Build/Base.pm:1258):
1258: for my $f ( map glob($_), @{ $unlink_list_for_pid{$$} || [] } ) {
--
Boyd Duffee Keele University (01782) 734225
Student Facing Systems
<DarthBart> Nobody "codes" in Perl. Perl programs are written by eating
a bag of alphabet pasta and then chasing it with ipecac.
<xaxa> My alphabet spaghetti only had A-Z. Perl uses the *other*
half of ASCII.
--------------030501060500020508080001
Content-Type: application/x-perl;
name="Build.PL"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="Build.PL"
#use strict;
use warnings;
use Module::Build;
my $builder = Module::Build->subclass(
class => "Module::Build::Custom",
code => <<'SUBCLASS' );
sub ACTION_install {
my $self = shift;
# for subclassing the install action - custom code here
$self->SUPER::ACTION_install;
}
SUBCLASS
$builder->new(
module_name => 'Keele::Utilities::Database',
license => 'perl',
dist_author => q{Boyd Duffee <b.duffee at isc.keele.ac.uk>},
dist_version_from => 'lib/Keele/Utilities/Database.pm',
requires => {
'DBI' => '1.52',
'Keele::Utilities' => '0.03',
'Date::Manip' => 0,
},
build_requires => {
'Test::More' => 0,
},
configure_requires => {
'Module::Build' => 0.38,
},
add_to_cleanup => [ 'Keele-Utilities-Database-*' ],
create_makefile_pl => 'traditional',
script_files => {
'script/get_my_network_usage.pl' => 0,
}
);
$builder->create_build_script();
--------------030501060500020508080001--