Subject: | Pod::Usage fails with prefix='~/something' |
From the Perl core bug queue... RT#96516
'perlbrew --help' displays the perlbrew source on my system.
Reason: The following lines in Pod/Usage.pm:
my $progpath = File::Spec->catfile($Config{scriptdir}, 'perldoc');
print { $opts{'-output'} } ($opts{'-message'}, "\n") if($opts{'-message'});
if(defined $opts{-input} && $opts{-input} =~ /^\s*(\S.*?)\s*$/) {
# the perldocs back to 5.005 should all have -F
# without -F there are warnings in -T scripts
system($progpath, '-F', $1);
The important bits:
my $progpath = File::Spec->catfile($Config{scriptdir}, 'perldoc');
system($progpath, '-F', $1);
This fails because $Config{scriptdir} eq '~/usr/local/script' here, and the
list form of system doesn't call the shell that would expand ~.
(It then proceeds to fall back to system($pager, $1), which is why I get raw
perl source in my face in response to --help.)
Looking at Config_heavy.pl it seems the correct variable to use is
$Config{scriptdirexp}, which contains an expanded path.