Subject: | Help dies if . in path |
Attached is a test script which when run gives the following error:
$ perl tclid
Error opendir on 'tclid': Not a directory at /home/dj/.perlbrew/libs/perl-5.18.2@dev/lib/perl5/CLI/Dispatch/Help.pm line 91.
if '.' is in Perl's lib path.
The error seems to be at line 91 of Help.pm:
86 foreach my $inc ( @INC ) {
87 foreach my $path ( @paths ) {
88 my $dir = path( $inc, $path );
89 next unless $dir->exists;
90 my $iter = $dir->iterator({recurse => 1});
91 while (my $file = $iter->()) {
92 next if $file->is_dir;
when $inc = '.' and $path = name of script, then $dir is the path to the
script and $dir->iterator gets unhappy because $dir isn't a directory.
Amending line 89 to
89 next unless $dir->exists && $dir->is_dir;
seems to do the trick.
Subject: | tclid |
Message body not shown because it is not plain text.