Subject: | Obscure Makefile.PL problem |
Hi, Tim.
I tried playing with Devel::SizeMe recently and had trouble building it due to unusual settings in my environment.
I encountered the following build error:
% perl Makefile.PL
No such file or directory at Makefile.PL line 140.
So I ran the following:
% perl -MFile::Spec::Functions=catfile -E 'use Config; say $Config{archlib}; say catfile( $Config{archlib}, "CORE", "hv.h" )'
~/perl-inst/perl5.18.0/lib/5.18.0/x86_64-linux
~/perl-inst/perl5.18.0/lib/5.18.0/x86_64-linux/CORE/hv.h
I realise it's unconventional to have a "~" here, but this is a perl binary I built myself and I haven't encountered problems doing this generally.
The following two commands show the problem caused by the "~":
% perl -E 'open my $dh, "<", "~/perl-inst/perl5.18.0/lib/5.18.0/x86_64-linux/CORE/hv.h" or die $!'
No such file or directory at -e line 1.
% perl -E 'open my $dh, "<", "/home/tom/perl-inst/perl5.18.0/lib/5.18.0/x86_64-linux/CORE/hv.h" or die $!'
To install Devel::SizeMe I added the following hack just before line 140 of Makefile.PL:
$file =~ s|~|/home/tom|;
This works fine for anyone who has $ENV{HOME} set to "/home/tom" so it's not a generally useful solution.
I thought I should let you know about this even though I suspect it's not a serious problem as few will encounter it.
Tom Hukins